SQL/MP Programming Manual for COBOL

Program Invalidation and Automatic SQL
Recompilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
8-3
Causes of Program Invalidation
Changing a collation, which includes dropping and then re-creating the collation,
renaming a collation, or changing a DEFINE that points to a collation
Executing an UPDATE STATISTICS statement with the RECOMPILE option
for a table (RECOMPILE is the default option)
Restoring a table, including an underlying table of a protection or shorthand view,
by using the RESTORE program with the SQLCOMPILE OFF option specified
Changes to the AUDIT Attribute
Changing the AUDIT attribute of a table referenced by an SQL statement does not
invalidate the program file. However, in these cases, changing the AUDIT attribute can
cause automatic SQL recompilation (if it is allowed):
If a statement performs a DELETE or UPDATE set operation on a nonaudited table
with a SYNCDEPTH of 1, the SQL executor returns SQL error 8203 and forces the
automatic recompilation of the statement.
If a statement is executed in parallel on a table whose AUDIT attribute has
changed since the last explicit SQL compilation, the SQL executor returns SQL
error 8207 and forces the automatic recompilation of the statement.
Operations That Do Not Invalidate a Program File
These operations performed on an SQL program file or to an SQL object referenced by
an SQL program file do not invalidate the program file:
Renaming a program file
Altering the security or owner of a program file or an SQL object
Restoring a program file by using the RESTORE program with the
SQLCOMPILE ON option specified
Creating a view on a table
Altering the file attributes of a table, except for changes to the AUDIT attribute as
described in Changes to the AUDIT Attribute on page 8-3
Adding an index to a table by using the CREATE INDEX statement with the
NO INVALIDATE option
Adding or dropping comments on an SQL object
Executing an UPDATE STATISTICS statement with the NO RECOMPILE option
specified for a table