SQL/MX 3.1 Programming Manual for C and COBOL (H06.23+, J06.12+)
C/C++ Program Compilation
HP NonStop SQL/MX Release 3.1 Programming Manual for C and COBOL—663854-001
15-25
Windows-Hosted SQL/MX C/C++ Preprocessor
sqlstate
issues a warning if SQLSTATE is undeclared or not declared as char
SQLSTATE[6] in the Declare section.
both
issues warnings if either or both SQLCODE and SQLSTATE are undeclared or
not declared as long SQLCODE and char SQLSTATE[6] respectively in the
Declare section.
-O
replaces Guardian DEFINE in the #include directive, in the OSS file format.
-f
specifies whether to reduce size by one or not for the null terminator of the
character type descriptor. The default value is CHAR_AS_STRING. The following
rules apply:
CHAR_AS_STRING – reduces the size by one from the value specified in the
variable declaration.
CHAR_AS_ARRAY – retains the size specified in the variable declaration.
Example—mxsqlc
Run the SQL/MX C/C++ preprocessor using the mxsqlc command. This C++ example
creates an annotated source file and module definition file:
mxsqlc sqlprog.ecpp -c sqlprog.cpp -x -m sqlprog.m -p \
-g moduleGroup=INVENTORY -g moduleVersion=V2
This C++ example creates a self-contained, annotated output source file that contains
an embedded module definition:
mxsqlc sqlprog.ecpp -c sqlprog.cpp -g moduleTableSet=TEST1
Windows-Hosted SQL/MX C/C++ Preprocessor
The Windows hosted SQL/MX C/C++ preprocessor is a DLL file named
mxsqlcnt.dll and is accompanied by a DLL loader named mxsqlc.exe. These
files are installed in the C:\Program Files\HP SQL-MX C Preprocessors
directory. Use either the command shell or the Korn shell to run the preprocessor with
the RUN command. You can also use ETK to build a C or C++ program. For more
information, see Building a C/C++ Program With Embedded SQL Statements on
Windows on page 15-52.
You can install multiple versions of the SQL/MX C/C++ preprocessors. The
environment variable MXSQLC enables you to select a particular version of the SQL/MX
C/C++ preprocessor for C/C++ compilations.










