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-4
Managing the Coexistence of Globally and Locally
Placed Modules
•
mxCompileUserModule
-g moduleGlobal | -g moduleLocal
•
mxcmp
-g moduleGlobal | -g moduleLocal=OSSdir
For additional details about setting the SQL/MX compiler options, see Compiling
Embedded Module Definitions on page 15-27 and 16-22 and Compiling a Module
Definition File on page 15-31 and 16-26.
Managing the Coexistence of Globally and Locally Placed
Modules
While it is recommended that you choose one approach for a production system
(locally or globally placed module generation), you might find a need to mix locally and
globally placed modules in your development environment. When you create new
applications that use locally placed modules but keep existing applications that use
globally placed modules, problems might occur if you are not careful.
The SQL/MX executor always searches for the module by first looking locally and then
globally. The execution of an application fails or yields unpredictable results if:
•
A locally placed module is deleted, and an older or unrelated module of the same
name exists in the /usr/tandem/sqlmx/USERMODULES directory.
•
A non-module file with the same name as a globally placed module exists in the
same OSS directory as the executable.
To avoid these problems:
•
Use a unique name for each module.
•
Use application file names that do not conflict with your carefully chosen module
names.
In an environment where globally and locally placed modules coexist, use one of these
methods to generate modules.
•
System-Wide Setting for Locally Placed Modules on page 17-4
•
System-Wide Setting for Globally Placed Modules on page 17-5
System-Wide Setting for Locally Placed Modules
To specify that modules are always placed in a local directory, insert the
MXCMP_PLACES_LOCAL_MODULES attribute and set it to ON in the
SYSTEM_DEFAULTS table. Remember that the setting in the SYSTEM_DEFAULTS
table affects all users on the same NonStop system.
To co-locate your modules with your application, ensure that you are in the same
directory as the application executable when you invoke mxcmp or
mxCompileUserModule. Otherwise, mxCompileUserModule and mxcmp place the