SQL/MP Programming Manual for COBOL

Program Invalidation and Automatic SQL
Recompilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
8-10
Preventing Automatic Recompilations
Specifying the CHECK INOPERABLE PLANS Option
To direct the SQL executor to use the similarity check for a program, specify the
CHECK INOPERABLE PLANS option when you explicitly compile the program as
shown in the next example:
SQLCOMP /IN sqlprog,OUT $s.#sqlist/ CHECK INOPERABLE PLANS
For the complete syntax of the CHECK option, see Section 6, Explicit Program
Compilation.
The CHECK INOPERABLE PLANS option directs the SQL compiler to store similarity
information in the program file. The SIMILARITYINFO column in the PROGRAMS table
indicates whether a program file contains similarity information:
To use the CHECK INOPERABLE PLANS option, you must have an SQL/MP software
version of 310 or later. If you specify a CHECK option, the SQL compiler sets the
program’s PFV to 310 (or later). The SQL compiler also sets the program’s PCV to 310
(or later). Therefore, the SQL catalog in which the program is registered must have a
catalog version of 310 (or later).
For more information, see the SQL/MP Version Management Guide.
Enabling the Similarity Check for Tables and Protection
Views
To use the CHECK INOPERABLE PLANS option, the similarity check must be enabled
for any referenced tables or protection views at run time. You must explicitly enable the
similarity check for a table or protection view, including any underlying tables for the
view, as shown in these DDL statements. (SQL/MP implicitly enables the similarity
check for other SQL objects.)
Y The execution plans in the program file contain similarity information.
N The program file does not contain similarity information.
CREATE TABLE table-name ...
[ SIMILARITY CHECK { ENABLE | DISABLE } ]
CREATE VIEW view-name ...
FOR PROTECTION
...
[ SIMILARITY CHECK { ENABLE | DISABLE } ]
ALTER TABLE table-name ...
[ SIMILARITY CHECK { ENABLE | DISABLE } ]
ALTER VIEW view-name ...
[ SIMILARITY CHECK { ENABLE | DISABLE } ]