Contents Index Backup functions Library function reference

ASA Programming Guide
  Embedded SQL Programming

The 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
-c "keyword=value;..." Supply reference database connection parameters [UltraLite]
-d Favor data size
-e level Flag non-conforming SQL syntax as an error
-f Put the far keyword on generated static data
-g Do not display UltraLite warnings
-h line-width Limit the maximum line length of output
-k Include user declaration of SQLCODE
-m version Specify the version name for generated synchronization scripts
-n Line numbers
-o operating-sys Target operating system.
-p project UltraLite project name
-q Quiet mode—do not print banner
-r Generate reentrant code
-s string-len Maximum string length for the compiler
-w level Flag non-conforming SQL syntax as a warning
-x Change multibyte SQL strings to escape sequences
-z sequence Specify collation sequence
See also 

Introduction

Description 

The SQL preprocessor processes a C or C++ program containing embedded SQL before the compiler is run. SQLPP 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 filename is the input-file with an extension of .c. If input-file has a .c extension, the default output filename extension is .cc.

Options 

-c    Required when preprocessing files that are part of an UltraLite application. The connection string must give the SQL preprocessor access to read and modify your reference database.

-d    Generate code that reduces data space size. Data structures are reused and initialized at execution time before use. This increases code size.

-e    This option flags any embedded SQL that is not part of a specified set of SQL/92 as an error.

The allowed values of level and their meanings are as follows:

-g    Do not display warning specific to UltraLite code generation.

-h    Limits the maximum length of lines output by sqlpp to num. The continuation character is a backslash (\) and the minimum value of num is ten.

-k    Notifies the preprocessor that the program to be compiled includes a user declaration of SQLCODE.

-m    Specify the version name for generated synchronization scripts. The generated synchronization scripts can be used in a MobiLink consolidated database for simple synchronization.

-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    Specify the target operating system. Note that this option must match the operating system where you run the program. A reference to a special symbol is generated in your program. This symbol is defined in the interface library. If you use the wrong operating system specification or the wrong library, an error is detected by the linker. The supported operating systems are:

-p    Identifies the UltraLite project to which the embedded SQL files belong. Applies only when processing files that are part of an UltraLite application.

-q    Do not print the banner.

-r    For more information on re-entrant code, see SQLCA management for multi-threaded or reentrant code.

-s    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', etc). 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.

-w    This option flags any embedded SQL that is not part of a specified set of SQL/92 as a warning.

The allowed values of level and their meanings are as follows:

-x    Change multibyte strings to escape sequences so that they can pass through compilers.

-z    This option specifies the collation sequence. For a listing of recommended collation sequences, type dbinit -l at the 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 SQLLOCALE environment variable.


Contents Index Backup functions Library function reference