SQL Programming Manual for TAL
Program Compilation and Execution
HP NonStop SQL Programming Manual for TAL—527887-001
5-10
Running the SQL Compiler
NORECOMPILE
directs the SQL compiler not to automatically recompile the program.
(Therefore, if any of the preceding run-time conditions occur, the program
cannot continue execution and would need explicit SQL compilation for
revalidation.)
RECOMPILEONDEMAND | RECOMPILEALL
specifies whether the compiler should recompile an entire invalid program or
only those SQL statements that require recompilation and are actually
executed. If you specify NORECOMPILE, this option is ignored.
RECOMPILEONDEMAND
directs the SQL compiler to recompile only those statements in the invalid
program that are actually executed. Automatic recompilation occurs the
first time an individual SQL statement is executed.
RECOMPILEALL
directs the SQL compiler to automatically recompile the entire program if it
is invalid. Automatic recompilation occurs at program load time.
RECOMPILEALL is the default.
In this example, the SQL compiler compiles the program file PARTOBJ, writes the
listing to the spooler location $S.#PARTLST, and records the program file in catalog
PROGCAT on volume $VOL1. Upon successful completion of the run, the compiler
rewrites PAROBJ as a validated SQL program file.
SQLCOMP /IN partobj, OUT $s.#partlst, NOWAIT / &
CATALOG $vol1.progcat
Access Privileges
To SQL compile a program file, you must have these access privileges:
•
Read and purge authority for the program file
•
Read and write authority for the PROGRAMS, USAGES, and TRANSIDS tables of
the catalog in which the program is to be registered
•
Read and write authority for the USAGES and TRANSIDS tables of any catalog in
which a table, view, or index that the program uses is registered
Caution. Do not use the same name for different procedures in separate source modules if
the modules contain SQL statements. NonStop SQL might interpret internal data structures as
duplicates, which would cause the SQL statements in one of the procedures not to be included
in the SQL object program.