Previous Topic

Next Topic

esqlc Command Line Reference

The esql command invokes the ESQL precompiler. Without any arguments, the esql command displays a summary of the command syntax and options described here.

The esql command also accepts the following arguments, detailed in this section:

  • Options specific to the esql precompiler
  • Options to be passed to the C compiler and linker for processing
  • The names of esql source code files, and optionally, C-language source and object files

Depending on the options included in the esql command, the precompiler translates the esql source files specified into C source files and then invokes the C compiler to compile and link them into executable objects.

Before invoking esql, make sure the PATH environment variable includes the directory that contains the esql image (the default location is C:\FairCom\Vx.xx\c-treeServers\Utils\bin).

Syntax

esqlc [ [ esql_option … ] [ c_option … ] file_name … ]
esql_option ::
         +T                        
|        +P                        
|        +B                        
|        +L                        
|        +V                        
|        +K                        
|        +G                        
|        +M                        
|        +D connect_string
|        +U user_name              
|        +A password

Arguments

esql_option

A list of precompiler-specific options. Precede esql-specific options with a plus sign ( + ) to avoid confusion with C compiler and linker options. The esql command passes all command line options that it does not recognize to the C compiler., providing the user a means to specify C compiler options directly as options to the esql command.

  • +T - Translates the embedded SQL source code to C source code withinvoking the C compiler to generate the object or executable files. If the command line omits this option, the precompiler invokes the C compiler
  • +P - Runs the C preprocessor on the input file before translating the c-treeSQL statements in the input file. This allows using #define symbols in ESQL declarations and statements. If the command line omits this option, the precompiler does not run the C preprocessor.
  • +B - Specifies that the precompiler link with shared libraries instead of static libraries. The effect of specifying the +B option is the same as setting the TPE_DLL environment variable to Y. For either to work correctly, the c-treeSQL libraries and executables must have been built specifying the USE_SHARED_LIBS directive through the TPE_ENV environment variable. See the c-treeSQL Installation and Release Notes for details. If the esql command omits the +B option, the default is to link with static libraries.
  • +L - Suppresses redefinition of source line numbers in the generated C code, to simplify debugging of host language statements. If the command line omits this option, the precompiler redefines source line numbers.
  • +V - Displays the commands the precompiler invokes as it processes the files.
  • +K - Keeps intermediate C source code and object files. If the command line omits this option, the precompiler does not keep the intermediate files.
  • +G - Inserts debugging code.
  • +M - Produces an executable that links the front and back end of the c-treeSQL engine in a single merged image. Specify this option with the -l C compiler option and the appropriate object library in $TPEROOT/lib. For example:

    esqlc +M progname -l$TPEROOT/lib/libstubs.a
  • +D connect_string - A string that specifies which database to connect to at compile time. The database is used for accessing the definition of tables used in the application code. The connect string can be a simple database name or a complete connect string. See the CONNECT statement in the c-treeSQL Reference Manual for details on how to specify a complete connect string. If omitted, the default value depends on the environment (on UNIX, the value of the DB_NAME environment variable specifies the default connect string).
  • +U user_name - The user name c-treeSQL uses to connect to the database specified in the connect_string. c-treeSQL verifies the user name against a corresponding password before it connects to the database. If omitted, the default value depends on the environment. (On Unix the value of the DH_USER environment variable specifies the default user name. If DH_USER is not set, the value of the USER environment variable specifies the default user name.
  • +A password - The password c-treeSQL uses to connect to the database specified in the connect_string. c-treeSQL verifies the password against a corresponding user name before it connects to the database. If omitted, the default value depends on the environment (on Unix the value of the DH_PASSWD environment variable specifies the default password).

c_option

C compiler options. The esql command passes any command line options that it does not recognize to the C compiler. Typical C compiler options you might use include:

-o

To specify the name of the output executable object

-c

To suppress linking of object files generated by the C compiler

See the documentation for the C compiler in your environment for details on valid options.

file_name

A list of esql source files (by convention, with a .pc file-name extension) for the precompiler to translate into C source files (which the precompiler generates with .c file-name extensions). The file_name argument can include C source files and object files. The precompiler passes them to the compiler and linker, respectively.