SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)

C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL523627-004
15-33
Compiling a Module Definition File
USERMODULES directory or co-locate the module with its application. For more
information, see Generating Locally or Globally Placed Modules on page 17-3.
-d compiler-attribute-name=compiler-attribute-value
specifies default attribute settings for compilation. The default attribute settings for
compilation override settings in the SYSTEM_DEFAULTS table but do not override
the object name qualification or the settings of embedded CONTROL QUERY
DEFAULT, DECLARE, or SET statements, which are in the input source file. For
more information, see the SYSTEM_DEFAULTS table in the SQL/MX Reference
Manual.
The OSS shell is used to invoke mxcmp. Consequently, you must adjust the syntax
for setting CONTROL QUERY DEFAULT attribute values for MP_SYSTEM and
MP_VOLUME. The OSS shell performs command/parameter substitution and
allows a \ (backslash) to quote special characters such as $.
This example shows how to set MP_SYSTEM and MP_VOLUME as mxcmp
command-line options:
to get MP_SYSTEM=\KINGPIN --> use -d MP_SYSTEM=\\KINGPIN
to get MP_VOLUME=$TX012 --> use -d MP_VOLUME=\$TX012
You must use a pair of backslashes when specifying the value for MP_SYSTEM
and one for MP_VOLUME.
module-definition-file
is the name of the input module definition file (.m) that was generated by the
C/C++ preprocessor (mxsqlc).
The static SQL/MX compiler provides backward compatible behavior. If the
SQLMX_PREPROCESSOR_VERSION environment variable is set to 800, mxcmp behaves
just like SQL/MX Release 1.8. Otherwise, mxcmp supports all SQL/MX Release 2.x
features and command-line options. For more information, see Influencing Module
Management Behavior on page 17-7.
Example—mxcmp
This command compiles the module definition file named sqlprog.m and displays
summary information in addition to error and warning messages. The -e option directs
mxcmp to return warnings rather than errors if tables referenced in the SQL statements
do not exist. The statement also specifies that the module should be placed in a
directory other than the default global directory:
mxcmp -e -v -g moduleLocal="/usr/mydir" sqlprog.m