Precompile Mode

When you run the preprocessor in precompile mode (using the -p startup parameter), it compiles and generates r-code files for various static ESQL statements. You can precompile only Data Manipulation Language (DML) statements. The preprocessor does not precompile Data Definition Language (DDL) statements. Instead, the preprocessor passes these statements to the ESQL-LIB interface for compilation and execution at application run time. If you run the preprocessor in precompile mode, it displays a warning message if it finds any static DDL statements in the file.

CAUTION: Any DML statements that you precompile before DDL statements actually execute (and change the schema) have the potential for cyclic redundancy check (CRC) conflicts during execution. Therefore, avoid preprocessing in precompile mode if your application modifies the schema.
Database Connection

To precompile your SQL, the preprocessor must connect to the database(s) that you want to access with your ESQL application. Therefore, start all database servers that you need before running the preprocessor.

Supply the preprocessor with the correct startup parameters to connect to these databases, including all database connection parameters that you pass to the sqlconn() ESQL-LIB function in your application. In precompile mode, the preprocessor acts as a Progress database client. For more information on database connection parameters, see the Progress Startup Command and Parameter Reference.

NOTE: Be sure that your SQL preprocessor contains all the network protocols and Progress DataServer capabilities that you require to compile and run static ESQL. Use the PROBUILD utility to reconfigure a new preprocessor, if necessary. For more information on PROBUILD, see the Progress Client Deployment Guide. If you are precompiling for a Progress DataServer database, connect to the schema-holder database; you do not need to connect to the non-Progress database.

R-code Generation

After connecting to databases, the preprocessor opens the specified ESQL source files, converts the appropriate ESQL statements to ESQL-LIB function calls and data declarations, and precompiles each static ESQL statement it encounters. For some SQL statements, the preprocessor generates an r-code file. (Even if a particular SQL statement appears more than once in the application, the preprocessor only generates a single r-code file for that SQL statement.) The preprocessor also generates code to pass the name of the generated r-code file (rather than the SQL statement itself) to the ESQL-LIB function that invokes the statement.

NOTE: In Version 9, Progress r-code is portable between operating systems and hardware platforms. If you are converting a Version 6 ESQL (HLI/C) application to run with Version 9, preprocess any source files in precompile mode to regenerate any precompiled r-code you want to maintain.

Error Handling

If the SQL Compiler detects an error in a static ESQL statement, it displays an error message on the screen and continues to compile the remaining static ESQL statements in the source file. The preprocessor generates r-code files for as many correct ESQL statements as it can. However, it only creates a preprocessed C source file if no errors are detected.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095