SQL preprocessor

The SQL preprocessor processes a C or C++ program containing embedded SQL before the compiler is run.

Syntax
sqlpp [  options ] input-file [  output-file ]
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, sqlpp -e c03 ... flags any syntax that is not part of the core SQL/2003 standard. The supported level values are:

  • c03   Flag syntax that is not core SQL/2003 syntax

  • p03   Flag syntax that is not full SQL/2003 syntax

  • c99   Flag syntax that is not core SQL/1999 syntax

  • p99   Flag syntax that is not full SQL/1999 syntax

  • e92   Flag syntax that is not entry-level SQL/1992 syntax

  • i92   Flag syntax that is not intermediate-level SQL/1992 syntax

  • f92   Flag syntax that is not full-SQL/1992 syntax

  • t   Flag non-standard host variable types

  • u   Flag syntax that is not supported by UltraLite

For compatibility with previous SQL Anywhere 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 sqlpp 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.
-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:

  • WINDOWS   Microsoft Windows

  • UNIX   Use this option if you are creating a 32-bit Unix application.

  • UNIX64   Use this option if you are creating a 64-bit Unix application.

-q Quiet mode—do not print messages.

-r-

Generate non-reentrant code. For more information about reentrant code, see SQLCA management for multi-threaded or 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. For more information, see Embedded SQL API reference.
-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, sqlpp -w c03 ... flags any SQL syntax that is not part of the core SQL/2003 syntax. The supported level values are:

  • c03   Flag syntax that is not core SQL/2003 syntax

  • p03   Flag syntax that is not full SQL/2003 syntax

  • c99   Flag syntax that is not core SQL/1999 syntax

  • p99   Flag syntax that is not full SQL/1999 syntax

  • e92   Flag syntax that is not entry-level SQL/1992 syntax

  • i92   Flag syntax that is not intermediate-level SQL/1992 syntax

  • f92   Flag syntax that is not full-SQL/1992 syntax

  • t   Flag non-standard host variable types

  • u   Flag syntax that is not supported by UltraLite

For compatibility with previous SQL Anywhere 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, enter dbinit -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. See SACHARSET environment variable, and SALANG environment variable.

input-file A C or C++ program containing embedded SQL to be processed.
output-file The C language source file created by the SQL preprocessor.
Description

The SQL preprocessor translates the SQL statements in the input-file into C language source that is put into the output-file. The normal extension for source programs with embedded SQL is .sqc. The default output file name is the input-file with an extension of .c. If input-file has a .c extension, the default output file name extension is .cc.

See also