SQL/MX 3.2.1 Management Manual (H06.26+, J06.15+)

Ensuring Proper Name Resolution
SQL/MX statements in programs must refer to database objects that exist on the production system
or are visible on a remote node. If the database object names in programs refer to DEFINEs, these
DEFINEs should be set in the environment where the programs will run. If the database object
names in programs refer to SQL/MP aliases, the SQL/MP aliases must be created on the production
system. The DEFINEs and SQL/MP aliases must map to existing database objects on the production
system or on a remote node.
Ensuring name resolution in the production system environment involves:
“Setting DEFINEs” (page 220)
“Setting SQL/MP Aliases” (page 220)
Setting DEFINEs
You can refer to an SQL/MP table or view with a class MAP DEFINE that resolves to a Guardian
physical name. When NonStop SQL/MX compiles such statements, it replaces the DEFINE name
in the statement with the Guardian name currently associated with the DEFINE.
The DBA is responsible for setting the DEFINEs for all applications running in the SQL/MX production
environment, including:
After moving applications from a development to a production system, make sure that the
DEFINEs are set in the production environment. Otherwise, programs do not SQL compile,
and if already SQL compiled on the development system, might execute unpredictably or not
at all on the production system.
In response to periodic changes to the database in the production environment, reset DEFINEs
to the latest database objects.
Use OBEY command files or scripts (OSS, Korn shell) to automate the process of setting large
numbers of DEFINEs for the applications running in a particular operating environment (OSS or
Guardian). Within each OBEY command file or script, check that SET DEFMODE ON is set, and
then use the DEFINE commands appropriate for that environment.
In the OSS environment, use the OSS add_define command to add class MAP DEFINEs for SQL/MP
tables or views:
add_define =define-name class=map
file=\\node.\$volume.subvol.table
NOTE: Precede the backslash (\) in the node name and the dollar sign ($) in the volume name
with the OSS shell escape character (\).
In the Guardian environment, use the TACL ADD DEFINE command to add class MAP DEFINEs
for SQL/MP tables or views:
ADD DEFINE =define-name, class=map
file \node.$volume.subvol.table
For more information, see the Open System Services Shell and Utilities Reference Manual and the
TACL Reference Manual.
For more information, see the SQL/MX Reference Manual and the SQL/MX Programming Manual
for C and COBOL.
Setting SQL/MP Aliases
To use ANSI names for SQL/MP tables or views, create an SQL/MP alias that maps to a Guardian
physical name.
In a distributed environment, when you create an SQL/MP alias name for an SQL/MP object on
a remote node, use a fully qualified SQL/MP object name. The SQL/MP aliases must be in SQL/MX
user catalogs that are visible on the nodes where the programs exist. For more information about
220 Managing Database Applications