SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-36
Running the SQL Compiler in the OSS Environment
If the program has not been previously compiled or if the program does not
contain similarity information, the COMPILE INVALID PLANS option directs the
SQL compiler to compile all SQL statements in the program.
INOPERABLE PLANS
directs the SQL compiler to explicitly compile these SQL statements:
Statements with inoperable plans (invalid plans that fail the similarity
check).
Uncompiled statements with empty sections. The SQL compiler generates
an empty section if an SQL statement references a nonexistent DEFINE or
SQL object. (The SQL compiler also generates empty sections for
CONTROL directives and DDL statements.)
Other SQL statements retain their existing execution plans.
The COMPILE INOPERABLE PLANS option stores similarity information in the
program file and updates the program’s name map and usages in the
USAGES tables.
If the program has not been previously compiled or if the program does not
contain similarity information, the COMPILE INOPERABLE PLANS option
directs the SQL compiler to compile all SQL statements in the program.
To terminate a compilation in the Guardian environment, use the Break key to return to
the Command Interpreter and stop the process using its process identification number.
Running the SQL Compiler in the OSS Environment
In the OSS environment, the SQL compiler is invoked by the cobol utility (on a TNS/R
system) with the -Wsql flag or by the nmcobol utility with the -Wsql or
-Wsqlcomp flag. For more information, see Running HP COBOL Compilers in the
OSS Environment on page 6-16 or the Open System Services Shell and Utilities
Reference Manual.
Using Current Statistics
For the SQL compiler to generate the best execution plan, it must have current
statistics for the referenced tables. SQL/MP does not automatically update these
statistics. A program must execute the UPDATE STATISTICS statement to generate
current statistics in a catalog.
To execute the UPDATE STATISTICS statement, the process started by the program
must:
Have read access to the table
Have write access to the catalogs that contain the table descriptions