SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-40
SQL Compiler Listings
SQL Compiler Listings
The SQL compiler writes all SQL statements in the program file to the listing (or OUT)
file. If an error or warning occurs, the compiler includes a message after the statement
that caused the problem. For DML statements, the compiler also includes the
estimated cost of processing the statement, which is a positive integer indicating the
relative cost. The larger the integer, the more CPU time and disk access time are
required to execute the statement. Example 6-1 is a sample compiler listing.
Example 6-1. Sample SQL Compiler Listing of a COBOL Program (page 1 of 2)
SQL - Source File = \NEWYORK.$SQL.SQLPGMS.COBPGM
SQL - SLT Index = 0, Run-Unit = NEWPART
30 DECLARE GET_SUPPLIER_CURSOR CURSOR FOR
31 SELECT SUPPNUM,
32 SUPPNAME,
33 STREET,
34 CITY,
35 STATE,
36 POSTCODE
37 FROM =SUPPLIER
38 WHERE SUPPNUM = :SUPPLIER-OF-PARTS
39 REPEATABLE ACCESS
40
*** Statistics: Estimated cost: 1
SQL - SLT Index = 1, Run-Unit = NEWPART
73 BEGIN WORK
SQL - SLT Index = 2, Run-Unit = NEWPART
97 INSERT INTO =PARTLOC
98 VALUES (:LOC-CODE OF PARTLOC-REC,
99 :PARTNUM OF PARTLOC-REC,
100 :QTY-ON-HAND OF PARTLOC-REC)
101
*** Statistics: Estimated cost: 1
SQL - SLT Index = 3, Run-Unit = NEWPART
110 INSERT INTO =PARTS
111 VALUES (:PARTNUM OF PARTS-REC,
112 :PARTDESC OF PARTS-REC,
113 :PRICE OF PARTS-REC,
114 :QTY-AVAILABLE OF PARTS-REC)
115
*** Statistics: Estimated cost: 2