SQL Programming Manual for Pascal
Program Compilation and Execution
HP NonStop SQL Programming Manual for Pascal—528614-001
5-31
Guidelines for Using DEFINEs
run-option
is a run option of the RUN command, as described in the TACL Reference Manual.
param-set
is a list of one or more parameters to pass to the program, with multiple
parameters separated by a space, as described in the TACL Reference Manual.
Guidelines for Using DEFINEs
A DEFINE is a named set of attributes and associated values stored in the process file
segment (PFS) of a process. DEFINEs enable you to specify information about a
process before you run the process. You specify this information by entering DEFINE
commands at your TACL or SQLCI prompt, or by calling NonStop Kernel operating
system procedure calls (or a by a combination of using both command and procedure
calls).
With NonStop SQL, you can use DEFINE names in your program to specify the names
of catalogs, tables, views, indexes, partitions, and other programs. If you use DEFINE
names in SQL statements to refer to these SQL objects, follow the guidelines in this
subsection. For more information about using DEFINEs with NonStop SQL, see the
SQL/MP Reference Manual.
Pascal Compilation
For Pascal compilation, set DEFINEs for any DEFINE names of tables or views you
use in INVOKE directives.
SQL Compilation
For SQL compilation, set DEFINEs for all DEFINE names you use in SQL statements.
The SQL compiler registers programs in a catalog. If you are SQL compiling an object
file, you might want to use a DEFINE to specify the catalog.
For explicitly recompiling a program, you can specify the DEFINE set stored in the
program file by using the SQLCOMP command STOREDDEFINES option.
If you specify a DEFINE name in an SQL statement that is not present in your current
set of DEFINEs, the SQL compiler issues a warning message and leaves the
statement uncompiled in the object file. When you run your program, NonStop SQL
tries again to compile the SQL statement using automatic recompilation. If the SQL
compiler fails to find the DEFINE name this time, it issues an error message.
Program Execution
For program execution, set DEFINEs for all DEFINE names used in SQL statements if
the current DEFINE set is not the same set used for SQL compilation. If the current
DEFINE set is different, the program is subject to automatic recompilation as described
under Understanding Automatic SQL Recompilation on page 5-24.