SQL/MX 2.x Installation and Management Guide (H06.10+, J06.03+)

Managing Database Applications
HP NonStop SQL/MX Installation and Management Guide544536-007
11-11
Setting DEFINEs
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
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 about DEFINE commands for the OSS and Guardian
environments, see the Open System Services Shell and Utilities Reference Manual
and the TACL Reference Manual.
For more information about DEFINEs, see the SQL/MX Reference Manual. For
information on how to use DEFINE names in SQL programs, see 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.
Note. Precede the backslash (\) in the node name and the dollar sign ($) in the volume name
with the OSS shell escape character (\).