SQL Programming Manual for Pascal

HP NonStop SQL Programming Manual for Pascal528614-001
6-1
6 Error and Status Processing
NonStop SQL returns error and status information to an application program following
the execution of each embedded SQL statement. NonStop SQL returns some
information to the integer SQLCODE variable and more extensive information to these
data structures:
SQL descriptor area (SQLDA). The SQLDA contains information about input
parameters and output variables in dynamic SQL statements.
SQL statistics area (SQLSA). The SQLSA contains SQL statistics and performance
information following the execution of DML statements and some dynamic SQL
statements.
This section describes how to check the SQLCODE variable and the SQL data
structures to get information about:
Errors and warnings after the execution of SQL statements
Performance and statistics after the execution of SQL statements
Dynamic SQL operations
Getting Error and Warning Information
NonStop SQL provides these methods you can use to check for and process errors
and warnings in your program:
Checking the value of the SQLCODE variable
Using the WHENEVER directive
Checking information in the SQL communication area (SQLCA)
Checking the SQLCODE Variable
NonStop SQL returns status to the SQLCODE variable after the execution of each
embedded SQL statement. The SQLCODE variable can have these values:
Each NonStop SQL message has an assigned code number that is returned to
SQLCODE. For the values for SQLCODE and their meanings, see the SQL/MP
Messages Manual.
Value Status
< 0 Error
> 0 Warning
0 Successful