The SQL preprocessor is an executable named iqiqsqlpp.
The preprocessor command line is as follows:
iqsqlpp [ options ] sql-filename [ output-filename ]
The preprocessor translates the embedded SQL statements in a C or C++ source file into C code and places the result in an output file. A C or C++ compiler is then used to process the output file. The normal extension for source programs with embedded SQL is .sqc. The default output file name is the sql-filename with an extension of .c. If the sql-filename has a .c extension, then the default output file name extension will change to .cc.
The following table describes the preprocessor options.
Option | Description |
---|---|
-d | Generate code that reduces data space size. Data structures are reused and initialized at execution time before use. This increases code size. |
-e level |
Flag as an error any static embedded SQL that is not part of a specified standard. The level value indicates the standard to use. For example, iqsqlpp -e c03 ... flags any syntax that is not part of the core SQL/2008 standard. The supported level values are:
For compatibility with previous SAP Sybase IQ versions, you can also specify e, i, and f, which correspond to e92, i92, and f92, respectively. |
-h width | Limit the maximum length of lines output by iqsqlpp to width. The continuation character is a backslash (\) and the minimum value of width is 10. |
-k | Notify the preprocessor that the program to be compiled includes a user declaration of SQLCODE. The definition must be of type long, but does not need to be in a declaration section. |
-m mode |
Specify the cursor updatability mode if it is not specified explicitly in the embedded SQL application. The mode can be one of:
|
-n | Generate line number information in the C file. This consists of #line directives in the appropriate places in the generated C code. If the compiler that you are using supports the #line directive, this option makes the compiler report errors on line numbers in the SQC file (the one with the embedded SQL) as opposed to reporting errors on line numbers in the C file generated by the SQL preprocessor. Also, the #line directives are used indirectly by the source level debugger so that you can debug while viewing the SQC source file. |
-o operating-system |
Specify the target operating system. The supported operating systems are:
|
-q | Quiet mode—do not print messages. |
-r- |
Generate non-reentrant code. |
-s len | Set the maximum size string that the preprocessor puts into the C file. Strings longer than this value are initialized using a list of characters ('a','b','c', and so on). Most C compilers have a limit on the size of string literal they can handle. This option is used to set that upper limit. The default value is 500. |
-u | Generate code for UltraLite. |
-w level |
Flag as a warning any static embedded SQL that is not part of a specified standard. The level value indicates the standard to use. For example, iqsqlpp -w c08 ... flags any SQL syntax that is not part of the core SQL/2008 syntax. The supported level values are:
For compatibility with previous SAP Sybase IQ versions, you can also specify e, i, and f, which correspond to e92, i92, and f92, respectively. |
-x | Change multibyte strings to escape sequences so that they can pass through compilers. |
-z cs |
Specify the collation sequence. For a list of recommended collation sequences, run iqinit -l at a command prompt. The collation sequence is used to help the preprocessor understand the characters used in the source code of the program, for example, in identifying alphabetic characters suitable for use in identifiers. If -z is not specified, the preprocessor attempts to determine a reasonable collation to use based on the operating system and the SALANG and SACHARSET environment variables. |
sql-filename | A C or C++ program containing embedded SQL to be processed. |
output-filename | The C language source file created by the SQL preprocessor. |