SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-35
Running the SQL Compiler in the Guardian
Environment
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. Other SQL statements retain their existing plans.
To use a COMPILE option, you must have an SQL/MP software version of 310 (or
later).
To support the COMPILE PROGRAM STORE SIMILARITY INFO, COMPILE
INVALID PLANS, or COMPILE INOPERABLE PLANS option, an SQL catalog must
have a catalog version of 310 (or later).
If you specify the COMPILE PROGRAM STORE SIMILARITY INFO, COMPILE
INVALID PLANS, or COMPILE INOPERABLE PLANS option (which stores
similarity information in the program file), the SQL compiler sets the program’s PFV
and PCV to 310. If you omit the COMPILE option or specify the COMPILE
PROGRAM option (the default), the SQL compiler sets the PCV to 1 (unless the
program includes other version 310 features).
PROGRAM [ STORE SIMILARITY INFO ]
directs the SQL compiler to explicitly compile all SQL statements in the
program. If you include the STORE SIMILARITY INFO clause, the SQL
compiler also stores similarity information for each SQL statement in the
program file.
CHECK PROGRAM is the default.
INVALID PLANS
directs the SQL compiler to explicitly compile these SQL statements:
Statements that reference changed DEFINEs.
Statements with plans that fail the redefinition timestamp check.
Statements with altered execution plans, which are invalid but operable
plans that the SQL compiler has updated without recompiling.
Uncompiled SQL statements with empty sections. The SQL compiler
generates an empty section if an SQL statement references a nonexistent
DEFINE or SQL object.
Other SQL statements retain their existing execution plans.
The COMPILE INVALID PLANS option stores similarity information in the
program file and updates the program’s dependencies on database objects in
the USAGES tables.