Product Documentation

FairCom ISQL

Previous Topic

Next Topic

Command Line Execution Using Interactive SQL - Linux

FairCom provides a makefile (drivers/sql.cli/cmdline/Makefile) that launches the four Interactive SQL tutorials in sequence with a pause between every tutorial. To execute them from the command line, perform the following:

  • Be sure the c-tree server is running.
  1. Open a command shell
  2. Change to the drivers/sql.cli/tutorials/cmdline folder.
  3. Execute the following:

make run

The output of this tutorial should appear similar to the following:

INIT

DEFINE

Create table...

MANAGE

Delete records...

0 records deleted.

Add records...

1 record inserted.

1 record inserted.

1 record inserted.

1 record inserted.

Display records...

NUMBER NAME

------ ----

1000 Bryan Williams

1001 Michael Jordan

1002 Joshua Brown

1003 Keyon Dooling

4 records selected

Delete records...

4 records deleted.

DONE

Running the Tutorials "By Hand"

Notice that the tutorials can also be run one by one “by hand” from the command line, from the parent folder, as follows:

In the command shell, change to the drivers/sql.cli/tutorials folder.

Execute each example as follows:

../../../tools/isql -s iSQL_Tutorial1.sql -u admin -a ADMIN ctreeSQL

../../../tools/isql -s iSQL_Tutorial2.sql -u admin -a ADMIN ctreeSQL

../../../tools/isql -s iSQL_Tutorial3.sql -u admin -a ADMIN ctreeSQL

../../../tools/isql -s iSQL_Tutorial4.sql -u admin -a ADMIN ctreeSQL

Note: Refer to Interactive SQL Command-Line Interface user guide for all of the supported command line switches.

Notice that tutorial #4 will throw four “Constraint violation” errors. This is expected and indicates correct behavior.

error(-20116): Constraint violation

NOTE: constraint violation expected

Troubleshooting

This section lists some of the errors that can occur when compiling and running these tutorials:

error in tcp bind 111
error(-20212): Error in Network Daemon

The most common cause of this error is that the FairCom Database Engine is not running on your machine. Remember that the c-tree evaluation license times out after 3 hours, so the server might have exited and needs to be re-started. See Starting the FairCom Database Engine for details.

TOCIndex