SQLSTATE Codes and Messages

SQLSTATE codes are required for entry level ANSI SQL compliance, and provide diagnostic infomration about warnings and exceptions.

Each SQLSTATE code consists of a 2-character class followed by a 3-character subclass. The class specifies general information about error type. The subclass specifies more specific information.

SQLSTATE codes are stored in the sysmessages system table, along with the messages that display when these conditions are detected. Not all SAP ASE error conditions are associated with a SQLSTATE code—only those mandated by ANSI SQL. In some cases, multiple SAP ASE error conditions are associated with a single SQLSTATE value.