Collection Contents Index The Write File utility CHAPTER 5.  Database Options pdf/chap4.pdf

Reference Manual
   CHAPTER 4. Database Administration Utilities     

The SQL preprocessor


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

Syntax 

sqlpp [ switches ] sql-filename [ output-filename ]

Switch

Description

-c "keyword=value;..."

Supply database connection parameters [Ultra:Lite]

-d

Favor data size

-e level

Flag non-conforming SQL syntax as an error

-f

Put the far keyword on generated static data

-h line-width

Limit the maximum line length of output

-n

Line numbers

-o operating-sys

Target operating system: WINNT, WINDOWS, NETWARE, UNIX, UNIX64, OS232

-p

Project name [ UltraLite ]

-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 

Application development using Embedded SQL

Description 

The SQL preprocessor processes a C or C++ program with 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 sql-filename with an extension of C. If the sql-filename has a C. extension, the output filename extension is CC by default.

Switches 

-c     Reserved for future use by UltraLite. Not supported in this release.

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

-e level     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:

-f     Put the far keyword in front of preprocessor-generated data. This may be required in conjunction with the Borland C++ compiler for the large memory model. By default, all static data is put in the same segment. Adding the far keyword will force static data into different segments. (By default, WATCOM C and Microsoft C place data objects bigger than a threshold size in their own segment.)

-h num     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.

-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 switch will make 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 will indirectly be used by the source level debugger so that you can debug while viewing the SQC source file.

-o operating-sys     Specify the target operating system. Note that this option must match the operating system where you will run the program. A reference to a special symbol will be 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 will be detected by the linker. The supported operating systems are:

-p     Reserved for future use by UltraLite. Not supported in this release.

-q     Operate quietly. Do not print the banner.

-r     Generate reentrant code (See SQLCA management for multi-threaded or reentrant code).

-s string-len     Set the maximum size string that the preprocessor will put into the C file. Strings longer than this value will be 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 level     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 sequence     This option specifies the collation sequence or filename. (For a listing of available collation sequences, type dbinit -l at the command prompt).


Collection Contents Index The Write File utility CHAPTER 5.  Database Options pdf/chap4.pdf