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 | Data Type | Purpose |
---|---|---|---|
SQLCAID | sqlcaid | char(8) | A character string (SQLCA) that identifies the beginning of the SQLCA. |
SQLCABC | sqlcabc | integer | Specifies the length of the SQLCA. Value is always 136. |
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 | smallint | The length of the SQLERRMC string (0 to 70). If 0, the value of SQLERRMC is not pertinent. |
SQLERRMC | sqlerrmc | varchar (70) | One or more tokens, separated by x'ff', that are substituted into error messages to provide specific information about an error condition. |
SQLERRP | sqlerrp | char(8) | Indicates the product signature in the format pppvvrrm where:
ppp = XDB vv = XDB version number rr = XDB release number m = Operating system: N = NT O = OS/2 D = DOS |
SQLERRD(1) | sqlerrd[0] | integer | Reserved for internal use. |
SQLERRD(2) | sqlerrd[1] | integer | Reserved for internal use. |
SQLERRD(3) | sqlerrd[2] | integer | Number of rows affected by an INSERT, UPDATE or DELETE command. |
SQLERRD(4) | sqlerrd[3] | integer | Not used by XDB Server. |
SQLERRD(5) | sqlerrd[4] | integer | Contains the position or column of a syntax error for a PREPARE or EXECUTE IMMEDIATE statement. |
SQLERRD(6) | sqlerrd[5] | integer | Not used by XDB Server. |
SQLWARN0 | sqlwarn0 | char(1) | Flag used to signal warning condition. If blank, then all other SQLWARN variables are blank. If value is W, then at least one other SQLWARN has a W. |
SQLWARN1 | sqlwarn1 | char(1) | If value is W, then at least one column's value was truncated when stored in a host variable. |
SQLWARN2 | sqlwarn2 | char(1) | If value is W, then at least one null value was eliminated from the argument of a column function. May not be set to W for a MIN function because its results are not dependent on the elimination of null values. |
SQLWARN3 | sqlwarn3 | char(1) | If value is W, then the number of columns is larger than the number of host variables. Contains Z if fewer locators were provided in the ASSOCIATE LOCATORS statement than the stored procedure returned. |
SQLWARN4 | sqlwarn4 | char(1) | If value is W, then a prepared UPDATE or DELETE statement does not contain a WHERE clause. |
SQLWARN5 | sqlwarn5 | char(1) | If value is W, your program tried to create an index that contains a field that exceeds the maximum length for an index. This use is XDB Server-specific. |
SQLWARN6 | sqlwarn6 | char(1) | Not used by XDB Server. |
SQLWARN7 | sqlwarn7 | char(1) | Not used by XDB Server. |
SQLWARN8 | sqlwarn8 | char(1) | Not used by XDB Server. |
SQLWARN9 | sqlwarn9 | char(1) | Contains Z if the stored procedure returned multiple result sets. |
SQLWARNA | sqlwarna | char(1) | Not used by XDB Server. |
SQLSTATE | sqlstate | char(5) | Contains SQLSTATE value for this error. |