SQL/MX 3.2.1 Programming Manual for C and COBOL (H06.26+, J06.15+)
C/C++ Program Compilation
HP NonStop SQL/MX Release 3.2.1 Programming Manual for C and COBOL—663854-005
15-17
Preprocessor Output
Preprocessor Output
C/C++ Annotated Source File for Embedded Module
Definitions
The SQL/MX C/C++ preprocessor processes a C/C++ source file, such as source-
file.sql, and generates one annotated source file (source-file.c in C or
source-file.cpp in C++) as its output file. The annotated source file contains the
embedded module definitions.
C/C++ Annotated Source File for Module Definition Files
If you use the -x or -m preprocessor option or if you set the
SQLMX_PREPROCESSOR_VERSION=800 environment variable, the preprocessor
processes a C/C++ source file, such as source-file.sql, and generates two files:
the annotated source file (source-file.c in C or source-file.cpp in C++) and the
module definition file (source-file.m).
For more information on module management behavior and influencing the
preprocessor, see Module Management Behavior on page 17-8. For recommended
naming conventions for C/C++ source files, see Table 17-1 on page 17-1.
The preprocessor converts embedded SQL statements to C comments, followed by the
appropriate CLI calls.
The C/C++ annotated source file consists of:
Header for Module Definition File
If you specify the -m or -x preprocessor option or set the
SQLMX_PREPROCESSOR_VERSION=800 environment variable, the preprocessor
Header Contains the declarations within the CLI functions and data
structures.
Body Contains the embedded SQL C/C++ source file translated into
C/C++ statements. The preprocessor encloses each embedded
SQL statement with C comment delimiters and follows the
commented statement with a CLI call that invokes the executor
at run time to execute the statement.
Trailer Contains definitions required to complete the C/C++ source file.
Definitions include the module version number, the creation
timestamp (the operating system timestamp when the
preprocessor was invoked), and the module name.










