SQLSTATE Values

OpenESQL statements return SQLSTATE values as defined by the X/Open and SQL Access Group SQL CAE specification (1992). SQLSTATE is a five character field that can be declared independently by an application, but which is also present in SQLCA, if declared. The table below lists SQLSTATE values that can be returned by OpenESQL statements.

The value returned in SQLSTATE consists of a two character class value followed by a three character subclass value. A class value of "01" indicates a warning and is accompanied by a SQLCODE of 1. Class values other than "01", except for the class "IM", indicate an error and are accompanied by a SQLCODE of -10000. The class "IM" is specific to warnings and errors that derive from the implementation of ODBC itself. The subclass value "000" in any class is for implementation defined conditions within the given class. The assignment of class and subclass values is defined by ANSI SQL-92.

Note:

Although successful execution of a function is normally indicated by a SQLCODE of 0, the SQLSTATE 00000 also indicates success.

SQLSTATE Error
01000 General warning
01002 Disconnect error
01004 Data truncated
01006 Privilege not revoked
01S00 Invalid connection string attribute
01S01 Error in row
01S02 Option value changed
01S03