SQL/MP Installation and Management Guide
Managing Database Applications
HP NonStop SQL/MP Installation and Management Guide—523353-004
10-22
Using the CHECK Option
Table 10-2 describes the behavior of the SQL executor when it encounters an invalid
static or dynamic statement during the execution of an SQL program compiled with a
CHECK option and the RECOMPILE or NORECOMPILE option for this situation. A
statement is invalidated during program execution when a DDL operation takes place
during program execution.
After SQL load time, the SQL executor detects invalid static or dynamic SQL
statements. (The RECOMPILEALL and RECOMPILEONDEMAND options do not
apply to this situation.)
Table 10-2. Behavior of the SQL Executor for an Invalid Statement Detected After
Load Time (page 1 of 2)
SQLCOMP
Option
Behavior
CHECK INVALID PROGRAM or CHECK INVALID PLANS Option
RECOMPILE The SQL executor recompiles (in memory) the invalid SQL statement
using Guardian names and DEFINE names as follows:
•
Uses names at SQL load time if execution-time name resolution is
not enabled
•
Uses names at statement execution time if execution-time name
resolution is enabled
NORECOMPILE The behavior depends on the type of statement:
•
For static SQL statements, the SQL executor returns an error to
the program and does not recompile the statement because of the
NORECOMPILE option.
•
For dynamic SQL statements, the SQL executor recompiles the
statement. The NORECOMPILE option has no effect on dynamic
SQL statements, and invalid dynamic plans are always recompiled.
CHECK INOPERABLE PLANS Option
RECOMPILE For an invalid static SQL statement, the SQL xecutor performs the
similarity check as follows:
•
If the similarity check passes, the SQL executor executes the
statement without recompilation.
•
If the similarity check fails, the SQL executor recompiles (in
memory) and executes the statement using Guardian names and
DEFINE names as follows:
Uses names at SQL load time if execution-time name resolution is
not enabled
Uses names at statement execution time if execution-time name
resolution is enabled