Using AcuSQL from the Compiler

Use the -Ps compiler switch, and specify the source file you wish to pre-process. For example:

ccbl -Ps [options] input_filename 

The following options are available to modify how AcuSQL executes from the compiler.

-Pc Directs the pre-compiler to connect to and use the database engine to perform SQL syntax checking. This switch should be used in conjunction with the Pd, Pu, and Pp switches; with the environment variables ACUSQL_DATASET, ACUSQL_USER, and ACUSQL_PASSWORD; or with some combination of switches and environment variables. Values given on the command line take precedence over values held by environment variables.

Note that during syntax verification, in some cases an error message may be converted to a warning message in order to prevent the compiler from aborting. The text of the warning message preserves the text of the error message.

-Pd dataset Is used in conjunction with the -Pc option and must be followed by the name of the ODBC data source to use.
-Pe*

*(see special note at the end of this list)

Includes ESQL lines in a listing or in the debugger. If you want to see the preprocessed output, use -Pe and include a source listing by using -Lf.
-Pi dir Specifies the path that the pre-compiler will search to locate files named in SQL INCLUDE statements. For example -Pi c:\SQL\include\ causes the pre-compiler to look in the C:\SQL\include directory for files named in SQL INCLUDE statements. You can also specify a search path via the ACUSQL_INCLUDE environment variable. Note that -Pi takes precedence over ACUSQL_INCLUDE when both are used. See Environment Variables for more information.
-Pk rlist Directs the pre-compiler to use the designated reserved word set for syntax checking. rlist can be DB2, to use the DB2 word set, "MSSQL" to use the Microsoft SQL Server word set, or EXT, to use the extended reserved word set. EXT is the default.

Note: The syntax of the ALTER, CREATE, and GRANT statements is not checked by either the Pr or Pk rlist modes. These statements are checked only when you use the -Pc mode to connect directly to the database engine.

-Pp password Is used in conjunction with the -Pc option and must be followed by the password that matches the username specified by the -Pu switch or by the ACUSQL_USER environment variable.
-Pr Directs the pre-compiler to perform relaxed syntax checking. -Pr is intended for use in situations where the embedded SQL syntax does not conform to IBM SQL, Transact-SQL, or SQL92, but is correct for the database that you want to access.

Pr does not perform syntax checking on the following statements:

SELECT INTO FROM
VALUES
DELETE
INSERT
DECLARE CURSOR FOR SELECT
UPDATE
Note: The syntax of the ALTER, CREATE, and GRANT statements is not checked by either the Pr or Pk rlist modes. These statements are checked only when you use the -Pc mode to connect directly to the database engine.
-Pu username Is used in conjunction with the -Pc option and must be followed by the username of an authorized database user.
-Pv Causes the compiler to treat group items as they were treated in releases earlier than Version 6.2; that is, group items containing both a numeric item and a character item only do not need to be level 49 to be treated as a VARCHAR. See Data Types for more information.
-Pw Causes the pre-compiler to dump the current reserved word list to standard output (use the -Pk option to set the reserved word list). No pre-compilation or compilation is performed. Note that Pw should not be used with any other pre-compiler switches. In AcuBench, Pw must be specified in the Additional options entry field at the top-right of the File Compiler Options dialog box.
Note: Previous versions of the compiler accepted -Po filename, which enables you to view the pre-processed output. The compiler no longer accepts -Po, however, it is allowed if running AcuSQL as a standalone program. If you are running AcuSQL from the compiler and want to view the pre-processed output, use -Pe as described above.