SQL/MP Programming Manual for COBOL85
Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
6-24
Required Access Authority
during compilation to generate a report on the execution plans for SQL DML
statements and the DEFINEs used by the program.
Required Access Authority
To run the SQL compiler for an SQL program file, you must have this access authority:
•
Read and purge access to the SQL program file
•
Read and write access to the PROGRAMS, USAGES, and TRANSIDS tables of
the catalog in which the SQL program file is to be registered
•
Read and write access to the USAGES and TRANSIDS tables of any catalog in
which a table, view, collation, or index that the SQL program file uses is registered
SQL Compiler Functions
The SQL compiler performs these functions:
•
Resolves names and expands SQL object names, including DEFINE names, using
the current default volume and the current catalog; then, stores the DEFINE names
in the SQL object file.
•
Performs type checking for COBOL and SQL data types.
•
Expands any views.
•
Checks object references in catalogs for SQL object names to verify their
existence and to read their descriptions, and then evaluates the object type and
characteristics for each reference.
•
Determines an optimized execution plan by analyzing SELECT, INSERT, UPDATE,
and DELETE statements to determine the best access paths and join, sort, and
blocking strategies; estimates the execution costs for DML statements based on
the statistics in the catalogs.
•
Generates executable code for the execution plans.
•
Registers the program in the specified PROGRAMS table and stores any
dependencies for tables, views, collations, and indexes in the USAGES table.
For example, if a program refers to a collation, SQLCOMP generates a row in the
USAGES table showing that the program depends on the collation and sets
USAGES.USEDOBJTYPE to CP.
Caution. You can use the Accelerator to optimize object code running on a TNS/R system.
The Accelerator, however, invalidates SQL program files. Therefore, run the Accelerator before
you explicitly SQL compile the program to avoid having to run the SQL compiler again. For
more information, see the Accelerator Manual.
In an OSS environment, the Accelerator is invoked by the cobol utility with the -Waxcel 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.










