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-12
Effect of Module Management Naming
Effect of Module Management Naming
Module management features qualify the name for the module that is encoded in the
module definition file and the C-annotated source file. By changing the name of the
module in the module definition file, the name of the module-file is also changed.
Table 17-3 lists the effects of combinations of group (MGSS), target or table set
(MTSS), and version (MVSS) attributes on the module file name.
Targeting
By using the target, or table set, attribute for module management, you can create
applications that target different sets of database objects (that is, tables, views, and so
on) from a single embedded SQL source file without changing the source code, the
default catalog or schema, or the MODULE directive. In the embedded SQL source
file, use class MAP DEFINEs for database object names and apply compile-time name
resolution (or PROTOTYPE host variables and build into your application the logic to
set these variables to their proper values at run time) to build applications that target
different sets of database objects without changing the source code. For more
information, see DEFINE Names for SQL/MP Objects on page 8-3 and Compile-Time
Name Resolution for SQL/MP Objects on page 8-6.
The target attribute is necessary if you want two or more targeted applications (and
their module files) to coexist and run concurrently on the same NonStop system.
Without the target attribute, each build of the application writes an identically named
module in the /usr/tandem/sqlmx/USERMODULES directory, unless you change the
MODULE directive in the source code or unless you have instructed the compiler to
generate locally placed modules. The target attribute prevents a subsequently built
application from overwriting the module file of the previously built application.
Table 17-3. Module Management Naming
Group
Specified?
TableSet
Specified?
Version
Specified? Module Management Qualified Name
Yes Yes Yes CAT.SCH.GRP^MOD^TABLESET^VER
Yes Yes No CAT.SCH.GRP^MOD^TABLESET^
Yes No Yes CAT.SCH.GRP^MOD^^VER
Yes No No CAT.SCH.GRP^MOD^^
No Yes Yes CAT.SCH.^MOD^TABLESET^VER
No Yes No CAT.SCH.^MOD^TABLESET^
No No Yes CAT.SCH.^MOD^^VER
No No No CAT.SCH.MOD
A bold circumflex (^) represents a module management attribute (group, table set, or version) that you did not
specify during preprocessing.