Class and Subclass Codes
The SQLSTATE status code is a five-character string that can contain only digits and uppercase letters.
The first two characters of the SQLSTATE status code indicate
a class. The last three characters of the SQLSTATE code indicate
a subclass. Structure of
the SQLSTATE Code shows
the structure of the SQLSTATE code. This example uses the value
08001
,
where 08
is the class code and 001
is
the subclass code. The value 08001
represents the
error unable to connect with database environment
.
The following table is a quick reference for interpreting class code values.
- SQLSTATE Class Code Value
- Outcome
- 00
- Success
- 01
- Success with warning
- 02
- No data found
- > 02
- Error or warning