SQL Programming Manual for Pascal

Program Compilation and Execution
HP NonStop SQL Programming Manual for Pascal528614-001
5-22
SQL Sensitive Program Files
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 have occurred during the compilation with the FORCE option 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 and SQL valid
SQL Sensitive Program Files
The SQL sensitive classification is required for program file execution. It also protects
the file from access by ENSCRIBE file handling utilities. The SQL compiler marks a file
as SQL sensitive by setting the SQL SENSITIVE flag in the file label.
SQL Valid Program Files
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). It 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 to Y and records the compilation
timestamp in the file label during explicit SQL compilation.
To determine whether a program file is valid or invalid, use either one of these
commands:
FUP FILEINFO command with the DETAIL option (described in the FUP Reference
Manual)
SQLCI VERIFY command (described in the SQL/MP Reference Manual)
Changes to a Program File
The following operations on a program file invalidate the file and reset the SENSITIVE
flag; an invalid program file has the SQL VALID 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—When you bind a file, the original file is unaffected, but the resulting
target file is invalid.
Dropping an SQL object that is referenced by the program.
Running the Accelerator on a file—If you run the Accelerator to optimize the object
code, the file becomes invalid.