SQL/MP Programming Manual for COBOL85
Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
6-33
Running the SQL Compiler in the OSS Environment
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 an OSS environment, the SQL compiler is invoked by the cobol utility with the
-Wsql flag. For more information, see Running the COBOL85 Compiler in the OSS
Environment on page 6-13, 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 the current
statistics for any 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, a program's PAID must have read
access to the table and write access to the catalogs that contain the table descriptions
and be the local owner of the table or a remote owner with purge access to the table
(or be the local super ID user).
In these examples, the first statement updates the statistics for all columns in the
ORDERS table. The second statement updates the statistics columns in the primary
key or clustering key or in any indexes for the table ODETAIL.
EXEC SQL UPDATE ALL STATISTICS FOR TABLE =ORDERS END-EXEC.
EXEC SQL UPDATE STATISTICS FOR TABLE =ODETAIL END-EXEC.
For more information about the UPDATE STATISTICS statement, see the SQL/MP
Reference Manual.
SQL Compiler Messages
The SQL compiler issues messages for error and warning conditions. An error can
prevent successful compilation of a program file, but a warning does not prevent
successful compilation. For a description of all SQL compiler messages, see the
SQL/MP Messages Manual.