Contents IndexThe Write File utility Chapter 40.  Watcom-SQL Language Reference

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 39. SQL Anywhere Components
      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 Favor code size
-d Favor data size
-elevel Flag non-conforming SQL syntax as an error
-f Put far keyword on generated static data
-hline-width Limit maximum line length of output
-luserid, pswd Logon identification
-n Line numbers
-ooperating-sys Target operating system specification DOS, DOS32, DOS286, WINDOWS, WIN32 OS232, WINNT, NETWARE, QNX32(default is DOS, OS232, or WINNT)
-q Quiet mode---do not print banner
-r generate reentrant code
-sstring-len Maximum string constant length for compiler
-wlevel Flag non-conforming SQL syntax as a warning
-zsequence Specify collation sequence

See also

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, then the output filename extension is CC by default.

Switches

-c Generate code that will favor code size and execution speed over data space size. Statically initialized data structures will be used as much as possible. This is the default.

-d Generate code that will reduce 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.

-l userid, password The named userid and password will be used for authorization of static SQL statements (see "Authorization").

-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 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 you will be running the program in. 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:

DOS MS-DOS or DR-DOS

DOS32 32-bit DOS extended program

DOS286 286 DOS extended program

WINDOWS Microsoft Windows 3.x

WIN32 32-bit Microsoft Windows

OS232 32-bit OS/2

WINNT Microsoft Windows NT

NETWARE Novell NetWare

QNX 16-bit QNX

QNX32 32-bit QNX

The default is DOS for the DOS version of SQLPP, OS232 for the OS/2 version, WINNT for the Windows NT version and QNX for the QNX version.

-r Generate reentrant code. This statement is only necessary when you are writing code that is reentrant (see "Multi-Threaded or Reentrant Code").

-q Operate quietly. Do not print the banner.

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

Contents IndexThe Write File utility Chapter 40.  Watcom-SQL Language Reference