SQL Programming Manual for TAL

Program Compilation and Execution
HP NonStop SQL Programming Manual for TAL527887-001
5-15
Running the SQL Compiler
For other cases, the SQL compiler first marks the statement as having insufficient
information to compile and then at run time tries to resolve the problem with automatic
recompilation. The SQL compiler does not record dependencies in the USAGES
catalog tables for the affected statement. At run time, if the necessary information is
still not available or any TACL DEFINEs are still unresolved, execution of the statement
causes an error. These cases are:
Insufficient information
The SQL compiler did not have enough information to determine the validity of a
statement. For example, an SQL statement refers to a table that is unavailable
because the table is on an unavailable remote node. (Another example is an SQL
statement that refers to a table that does not exist. This case always occurs for a
program that both creates and refers to a table; the table, of course, does not exist
when the program is explicitly SQL compiled.)
Unresolved TACL DEFINEs
An SQL statement often uses a TACL DEFINE name that is not present in the DEFINE
set when the program is explicitly SQL compiled.
SQL Compiler Listings
The SQL compiler writes all the SQL statements in the program file to a listing. If error
or warning conditions occur, the compiler writes messages following the statements
that cause the condition.
For SQL DML statements, the SQL compiler includes the estimated cost of processing
the statement in the listing following the statement. This estimate is a positive integer
that indicates the relative cost. For example, the larger the value, the more processor
time and disk access time is required to execute the statement.
Figure 5-3
shows a sample SQL compiler listing.