SQL/MP Programming Manual for COBOL85

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL85429326-004
6-31
Running the SQL Compiler in the Guardian
Environment
CHECK INVALID PROGRAM is the default.
INVALID PLANS
specifies that the SQL executor should automatically recompile an SQL
statement if either of these conditions occur (and NORECOMPILE is not
specified):
The statement is invalid.
The statement references a DEFINE at SQL load time that has changed
since the last explicit SQL compilation.
The SQL executor uses the execution plans from the program file for other
SQL statements.
During explicit SQL compilation, the CHECK INVALID PLANS option causes
the SQL compiler to store similarity information in the program file (even if the
similarity check is not enabled for the table or protection view).
INOPERABLE PLANS
specifies that the SQL executor should perform the similarity check on each
SQL object in an SQL statement if the similarity check is enabled for
referenced tables and protection views and either of these conditions occur:
The statement is invalid.
The statement references a DEFINE at SQL load time that has changed
since the last explicit SQL compilation.
If the similarity check passes, the SQL executor considers the plan to be
operable (although it might not be optimal) and executes the statement without
automatically recompiling it. If the similarity check fails, the SQL executor
considers the plan to be inoperable. The SQL executor then recompiles (in
memory only) the statement that generated the inoperable plan (if
NORECOMPILE is not specified) and executes the recompiled statement.
During explicit SQL compilation, the CHECK INOPERABLE PLANS option
causes the SQL compiler to store similarity information in the program file
(even if the similarity check is not enabled for the table or protection view).
COMPILE
determines which SQL statements are compiled during an explicit SQL
compilation. You can direct the SQL compiler to use the similarity check to
determine if a statement’s execution plan from a previous compilation is operable.
The SQL compiler then recompiles only the statements that fail the similarity
check; the other SQL statements retain their existing plans
To use a COMPILE option, you must have an SQL/MP software version of 310 (or
later).