SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
Program and Module Management
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
17-6
Managing Modules
The directory path in mxCompileUserModule -g moduleLocal dir/app.exe
states both where the application is located and where to co-locate the module
with the application. You can invoke mxcmp or mxCompileUserModule with the
-g moduleLocal option from any OSS directory and automatically co-locate the
module with the application.
•
Set the MXCMP_PLACES_LOCAL_MODULES attribute only in the
SYSTEM_DEFAULTS table.
The MXCMP_PLACES_LOCAL_MODULES attribute in the SYSTEM_DEFAULTS
table establishes a system-wide policy. Avoid these ways of setting
MXCMP_PLACES_LOCAL_MODULES:
°
In an embedded CONTROL QUERY DEFAULT statement in an application
°
With the -d option in mxcmp or mxCompileUserModule
The syntax for these methods is valid but could be complicated and problematic.
For example, this command places the module in the current directory where you
invoke mxCompileUserModule instead of in the same directory as the
application executable:
mxCompileUserModule -d MXCMP_PLACES_LOCAL_MODULES=ON
dir/app.exe
Instead, you can more easily invoke this command from any OSS directory to co-
locate the module with the application:
mxCompileUserModule -g moduleLocal dir/app.exe
Embedding a static CONTROL QUERY DEFAULT statement with
MXCMP_PLACES_LOCAL_MODULES ‘ON’ directs the SQL/MX compiler to
generate a locally placed module for the application in the OSS directory where
you invoke mxCompileUserModule or mxcmp. Embedding a dynamic CONTROL
QUERY DEFAULT statement with MXCMP_PLACES_LOCAL_MODULES ‘ON’
directs any SQL/MX compiler process spawned by the application to generate
locally placed modules in the current directory.
Therefore, for the best results, set the MXCMP_PLACES_LOCAL_MODULES
attribute in the SYSTEM_DEFAULTS table or set locally or globally placed
modules on a case-by-case basis with the -g moduleLocal or -g
moduleGlobal options of mxcmp and mxCompileUserModule.
Managing Modules
For an embedded SQL application to run properly, you must maintain the modules of
that application in either the /usr/tandem/sqlmx/USERMODULES directory or a
locally defined directory. For information on the consequences of mismanaged
modules, see Running an SQL/MX Application on page 15-58 (C/C++) or Running an
SQL/MX Application on page 16-43 (COBOL). For information on locally placed
modules, see Generating Locally or Globally Placed Modules on page 17-3.
Module management tasks include: