SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)
Introduction
HP NonStop SQL/MX Programming Manual for C and COBOL—544617-003
1-12
Compiling and Building an Application
Alternatively, you can commit changes automatically at the end of each SQL statement
by using SET TRANSACTION AUTOCOMMIT ON at the beginning of your program.
The default for embedded SQL is AUTOCOMMIT OFF.
If you exit a program without using either of these methods, any uncommitted changes
are automatically rolled back.
See also Section 14, Transaction Management.
Compiling and Building an Application
NonStop SQL/MX provides two methods of creating a module:
•
Processing With Embedded Module Definitions on page 1-12
•
Processing With Module Definition Files on page 1-12
The first method is the default method of processing programs in SQL/MX Release 2.x
and later product versions. The second method is the only method of processing
programs in SQL/MX Release 1.8. Although identical module definitions and identical
modules are produced with either technique, HP recommends that you produce
modules by using embedded module definitions.
By default, modules are created in the /usr/tandem/sqlmx/USERMODULES
directory. Command line options with mxCompileUserModule and mxcmp and the
MXCMP_PLACES_LOCAL_MODULE default setting provide the ability to place
modules in local directories.
Processing With Embedded Module Definitions
This method, which is the default method in SQL/MX Release 2.x and later product
versions, does not use module definition files (.m files) for SQL/MX-specific information
to be SQL compiled. The preprocessor reads a 3GL source file that contains C/C++ or
COBOL and SQL statements and generates one file: a single, self-contained source
file that contains embedded module definitions. The annotated source file contains the
source statements with the SQL statements converted to comments. To produce the
module, compile the source file with the host language compiler and use the
mxCompileUserModule command-line tool to SQL compile the embedded module
definition.
For more information, see:
•
Section 15, C/C++ Program Compilation
•
Section 16, COBOL Program Compilation
•
Section 17, Program and Module Management
Processing With Module Definition Files
This method, which is the only method you can use in SQL/MX Release 1.8, generates
module definition files (.m files). The preprocessor reads a 3GL source file that contains










