SQL Programming Manual for TAL

Program Compilation and Execution
HP NonStop SQL Programming Manual for TAL527887-001
5-22
Determining Program File Validity
Determining Program File Validity
SQL program files can be valid or invalid. A valid program file can execute with the
current description of the database. Certain operations performed on the program file
or on database objects used by the program cause a program file to become invalid.
An invalid program file requires SQL recompilation because of changes to either itself
or the database (or both).
The SQL compiler validates a program file after a successful explicit SQL compilation
or after errors occurred during the compilation and the FORCE option was in effect.
The SQL compiler records the validation in the file label of the program file and in the
PROGRAMS catalog table. A program file has two classifications for SQL validation:
SQL sensitive
SQL valid
The SQL sensitive classification is required for program file execution. It also protects
the file from access by Enscribe utilities. The SQL compiler marks a file as SQL
sensitive by setting the SQL sensitive flag in the file label.
The SQL valid classification indicates that the program file can execute without
automatic recompilation. An SQL valid program contains compiled SQL statements
(rather than SQL source statements). An SQL valid program ensures better
performance because a fully optimized execution plan is available and no automatic
SQL recompilation is required. The SQL compiler sets the SQL valid flag and records
the compilation timestamp in the file label during explicit SQL compilation.
To determine whether an SQL program file is valid or invalid, use one of these
commands:
FUP FILEINFO command with the DETAIL option (described in the FUP Reference
Manual)
SQLCI FILEINFO or VERIFY command (described in the SQL/MP Version
Management Guide
)
Changes to a Program File
The following operations on a program file invalidate the file. An invalid program file
has the VALID flag and the SQL SENSITIVE flag set to N in its file label.
Moving or copying a file. For example, if you use the FUP DUPLICATE command
to copy a program file, the original file is unaffected, but the new file is invalid.
Binding a file. If you explicitly bind a file, the original file is unaffected, but the
resulting target file is invalid.
Running the Accelerator on a file. If you run the Accelerator to optimize the object
code, the file becomes invalid.