SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-32
Running the SQL Compiler in the Guardian
Environment
If the program uses the similarity check, automatic recompilation might not
occur. For more information, see Section 8, Program Invalidation and
Automatic SQL Recompilation.
NORECOMPILE
directs the SQL executor not to automatically recompile the program. If any of
the conditions described under the RECOMPILE option occur during
execution, an error is generated, and the program is subject to explicit SQL
recompilation for validation.
RECOMPILEONDEMAND | RECOMPILEALL
specifies whether the SQL executor should invoke the recompilation of an entire
invalid program or only SQL statements actually executed. If you specify
NORECOMPILE, this option is ignored.
RECOMPILEONDEMAND
directs the SQL executor to recompile only the statements in the invalid
program that are actually executed. Automatic recompilation occurs the first
time the individual SQL statement is executed.
RECOMPILEALL
directs the SQL executor to automatically recompile the entire program at SQL
load time if it is invalid. RECOMPILEALL is the default.
REGISTERONLY
directs the SQL compiler to register a previously SQL compiled program in a
specific catalog without recompiling the program. To use the REGISTERONLY
option, you must have an SQL/MP software version of 310 (or later).
ON
directs the SQL compiler to register a program in the specified catalog without
compiling the SQL statements in the program or creating a new program file.
The SQL compiler marks the program’s file label as SQL sensitive and SQL
valid. The program retains its existing execution plans. If the program was not
previously SQL compiled, the operation fails with SQL error 2115.
The CATALOG option is the only other SQLCOMP option you can specify with
the REGISTERONLY ON option. If you specify an option other than CATALOG,
the operation fails with SQL error 2111. If the program was previously compiled
with the NOREGISTER ON option, the operation fails with SQL error 2108. If
the program was modified by the Binder program or linker after it was SQL
compiled, the operation fails with SQL error 2103.