SQL Programming Manual for TAL

Error and Status Processing
HP NonStop SQL Programming Manual for TAL527887-001
6-10
Getting Performance and Statistics Information
If your program uses the NUMOUT procedure to display an error message, you must
remove the negative sign before displaying the error number. To avoid this situation,
use the INCLUDE SQLCA directive and then call the SQLCADISPLAY procedure to
display the error message.
For more information about SQL system procedures, see Section 4, System
Procedures
Getting Performance and Statistics
Information
NonStop SQL uses the SQL statistics area (SQLSA) to communicate statistics to a
TAL program. NonStop SQL returns a new set of statistics in the SQLSA following the
execution of these statements:
The OPEN, FETCH, SELECT, INSERT, UPDATE, and DELETE statements A
PREPARE statement that describes input parameters and output columns associated
with a dynamic SQL statement that was prepared Use the INCLUDE SQLSA directive
to declare the SQLSA in your program. The syntax is:
Place the INCLUDE SQLSA directive in your program with:
Global declarations to use the SQLSA throughout your program
Local declarations to use the SQLSA for special purposes (for example, one
SQLSA for PREPARE statements and another SQLSA for DML statements)
Figure 6-4. Calling an SQL System Procedure
INCLUDE SQLSA
?SOURCE $system.system.extdecs (SQLCADISPLAY,
?
SQLCAFSCODE
,
SQLCAGETINFOLIST,
?
SQLCATOBUFFER)?
!
Global declarations:
EXEC SQL INCLUDE SQLCA;
. . .
! Error handling routine:
. . .
. . .
CALL SQLCADISPLAY (SQLCA);
VST0604.vsd