SQL Programming Manual for Pascal

Error and Status Processing
HP NonStop SQL Programming Manual for Pascal528614-001
6-9
Getting Execution Statistics
To include declarations for these procedures in your program, use the SOURCE
directive for the PEXTDECS file (include the TYPE section).
Example
The following example calls the SQLCADISPLAY procedure.
?SOURCE $ VOL.SUBVOL.PEXTDECS (TYPES,
? SQLCADISPLAY,
? SQLCAFSCODE,
? SQLCAGETINFOLIST,
? SQLCATOBUFFER)
{ Variable declarations: }
...
EXEC SQL
INCLUDE SQLCA ;
{ Error handling code: }
SQLCADISPLAY (XADDR(SQLCA)) ;
For more information about SQL system procedures, see Section 4, NonStop SQL
System Procedures.
Getting Execution Statistics
The INCLUDE SQLSA directive declares a data structure that SQL can use to store
execution statistics in the Pascal program.
SQL Statements’ Effect on the SQLSA
SQL statements report statistics to the SQLSA as follows:
DML Statements
Each INSERT, UPDATE, or DELETE statement reports execution statistics.
Each SELECT INTO host variables also reports execution statistics.
Table 6-2. System Procedures for the SQLCA
System Procedure Description
SQLCADISPLAY Writes to a file or to a terminal the error or warning messages
returned to the program by SQL
SQLCAGETINFOLIST Writes to a record area in the program a subset (which you
specify) of the error or warning information in the SQLCA
SQLCATOBUFFER Writes to a record area in the program the error or warning
messages returned to the program by SQL
SQLCAFSCODE Returns information about file-system, disk-process, or NonStop
Kernel operating system errors