SQL Programming Manual for TAL
Program Compilation and Execution
HP NonStop SQL Programming Manual for TAL—527887-001
5-32
Estimating Program Size
SQL Compilation
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 TACL 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 on page 5-24
.
Before issuing the RUN command, you can specify TACL DEFINE commands that
apply to SQL statements in the program. You can create, modify, delete, and display
DEFINEs with TACL commands or Guardian system procedure calls. You can also
specify the =_SORT_DEFAULTS DEFINE to control sort operations. However, if you
modify a DEFINE after SQL load time, the change has no effect on static SQL
statements.
To determine the DEFINE set with which a program was compiled, use the EXPLAIN
DEFINES option of the SQLCOMP command.
When the process begins execution, it receives your current set of DEFINE values
from the process file segment (PFS) of your TACL process, provided the DEFMODE
option is ON. If DEFMODE is OFF, TACL propagates only your =_DEFAULTS DEFINE
to the new process.
Estimating Program Size
A program that uses embedded SQL statements and directives to access a NonStop
SQL database uses much more memory than a program that accesses an Enscribe
database. This subsection describes how to estimate the virtual memory used by
embedded SQL statements and directives in a program’s extended data segment.
Some statements require no extra extended memory, but other statements generate a
run-time call to the SQL executor and do use extra memory. The SQL executor uses
extended memory to run and the memory shown below for parameters and data
structures.