This chapter describes Adaptive Server’s SQLSTATE status codes and their associated messages.
SQLSTATE codes are required for entry level ANSI SQL compliance. They provide diagnostic information about two types of conditions:
Warnings – conditions that require user notification but are not serious enough to prevent a SQL statement from executing successfully
Exceptions – conditions that prevent a SQL statement from having any effect on the database
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 Adaptive Server error conditions are associated with a SQLSTATE code—only those mandated by ANSI SQL. In some cases, multiple Adaptive Server error conditions are associated with a single SQLSTATE value.