SQL/MP Installation and Management Guide

Managing Database Applications
HP NonStop SQL/MP Installation and Management Guide523353-004
10-32
Using DEFINEs During Compilation
In SQLCI, the DELETE DEFINE, ALTER DEFINE, and ADD DEFINE commands
apply only to the DEFINE set for the SQLCI session. For example, in an SQLCI
session, if you alter a DEFINE inherited from the command interpreter process, the
DEFINE is altered only for the SQLCI session. When you return to the command
interpreter prompt after ending the SQLCI session, the original DEFINE is still in
effect.
Using DEFINEs During Compilation
Use DEFINEs to establish various attributes and other values during compilation.
These compiler options control the DEFINE set in effect during the compilation:
CURRENTDEFINES— selects the set of DEFINEs in effect for logical name
mapping at the time of the last explicit or automatic compilation. This option is the
default.
STOREDDEFINES— selects the DEFINE name mapping stored with the program
from the last explicit SQL compilation.
The SQL compiler stores the DEFINEs current at explicit compile time in the
program code.
Your choice of compiler option for DEFINEs depends on the situation. If you are
explicitly compiling a program because a table has a new index, you should use
the STOREDDEFINES option. This option ensures that all the original DEFINEs
are used, thereby eliminating the possibility of setting incorrect DEFINEs. You
should not use STOREDDEFINES when compiling a program for the first time,
because the program has no stored DEFINEs.
If you are explicitly compiling a program because a table has been moved, you
should use the CURRENTDEFINES to enable the current set of DEFINEs to
identify the new location of the table.
Using DEFINE Names With Programs
Use DEFINEs to establish various attributes and other values for your programs to
use. These guidelines apply to using DEFINEs:
To refer to DEFINEs within your programs, you must create the DEFINEs during
your command interpreter session with the DEFMODE option set to ON. The
DEFINE set is inherited by the compilers and programs that are subsequently
started. DEFINEs that are referred to in a program are evaluated, and physical file
names are resolved first, at compile-time.
If your application executes in a Pathway transaction processing environment,
however, you specify DEFINE names for a server class by using the SET SERVER
DEFINE command, as described under Using DEFINEs With PATHMON on
page 10-37.