SQL Programming Manual for Pascal
Program Compilation and Execution
HP NonStop SQL Programming Manual for Pascal—528614-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.
Example of Running the SQL Compiler
In the following example, the SQL compiler compiles the program file name 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 file PARTOBJ as a validated SQL program file.
SQLCOMP /IN PARTOBJ, OUT $S.#PARTLST, / CATALOG $VOL1.PROGCAT
Access Privileges
To SQL compile a program file, you must have these access privileges:
•
Read and purge authority to the program file
•
Read and write authority to the PROGRAMS, USAGES, and TRANSIDS tables of
the catalog in which the program is to be registered
•
Read and write authority to the USAGES and TRANSIDS tables of any catalog in
which a table, view, or index that the program uses is registered
Note. 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 causes the SQL statements in one of the procedures not be included in the
SQL object program.