01 SQLCA.
05 SQLCAID PIC X(8). 05 SQLCABC PIC S9(9) COMP. 05 SQLCODE PIC S9(9) COMP. 05 SQLERRM. 49 SQLERRML PIC S9(4) COMP. 49 SQLERRMC PIC X(70).
05 SQLERRP PIC X(8). 05 SQLERRD OCCURS 6 TIMES PIC S9(9) COMP. 05 SQLWARN. 10 SQLWARN0 PIC X(1). 10 SQLWARN1 PIC X(1). 10 SQLWARN2 PIC X(1). 10 SQLWARN3 PIC X(1). 10 SQLWARN4 PIC X(1). 10 SQLWARN5 PIC X(1). 10 SQLWARN6 PIC X(1). 10 SQLWARN7 PIC X(1). 05 SQLEXT. 10 SQLWARN8 PIC X(1). 10 SQLWARN9 PIC X(1). 10 SQLWARNA PIC X(1). 10 SQLSTATE PIC X(5).
The SQLCA is described in the following table, including the field names used in each language, the data type, and a discussion of the purpose of each field.
COBOL
Name | C
Name | PL/I
Name | Data
Type | Purpose | SQLCAID | sqlcaid | SQLCAID | char(8) | A character string (SQLCA) that identifies the beginning of the SQLCA. | SQLCABC | sqlcabc | SQLCABC | integer | Specifies the length of the SQLCA. Value is always 136. | SQLCODE | sqlcode | SQLCODE | integer | Contains a return code pertaining to the most recent SQL statement executed. Important values are:
0 Statement executed successfully (may have had warnings).
>0 Executed successfully but with an exception condition.
<0 An error occurred.
100 End of data reached. | SQLERRML | sqlerrml | SQLERRML | smallint | The length of the SQLERRMC string (0 to 70). If 0, the value of SQLERRMC is not pertinent. | SQLERRMC | sqlerrmc | SQLERRMC | varchar (70) | One or more tokens, separated by x'ff', that are substituted into error messages to provide specific