SQLCA is used with embedded SQL applications only. Stored procedures using SQLCODE to report status declare an SQLCODE variable and interrogate it to determine statement status.
The SQLCA fields are described in the following table:
Field Name | Format | Description |
---|---|---|
SQLCAID | CHARACTER(8) | Contains the characters ‘SQLCA. ’ |
SQLCABC | INTEGER | Length of the SQLCA (136 (x’88’)). |
SQLCODE | INTEGER | Primary indicator of the result of SQL statement execution.
The possible values for SQLCODE and their definitions are detailed in Messages Reference. |
SQLERRM | VARCHAR(70) | Contains the error message inserts for the SQLCODE associated with variable information. The SQLERRM field inserts are presented to the application as a single character string. The length of the string is provided, but the lengths of the individual inserts are not. The string begins with a 16-bit word that contains the length of the remaining data. The data consists of as many as 70 characters of insert text, with the character X’FF’ serving as a separator between inserts. If the inserts and separator characters are greater than 70 characters, then the array is truncated at the right. As an example, with a SQLCODE of -552, which is a privileges violation, SQLERRM contains the following three or four inserts:
|
SQLERRP | CHARACTER(8) | Contains the name of the preprocessor module that detected the error. |
SQLERRD | 6-word array | Contains miscellaneous information stored in an array. Because array addressing nomenclature differs among C, COBOL, and PL/I, the following description of the six SQLERRD words is not numbered. In order, the six words are the following:
|
SQLWARN | CHARACTER(11) array | Indicates the presence of warning conditions. Except for SQLWARN6, each character takes either the value pad character or ‘W’. The 11 characters of SQLWARN are defined as follows:
|
SQLEXT | CHARACTER(5) | Contains the SQLSTATE value associated with the SQLCODE |