Appendix A: SQLSTATE

<< Firebird 2.5 project teams | Firebird 2.5.3 Release Notes | B. License notice >>

Appendix A: SQLSTATE


SQLSTATE codes & messages

In this Appendix are all of the SQLSTATE codes currently supported:

1. The 5-character SQLSTATE code returned by the status array consists of SQL CLASS (2 characters) and SQL SUBCLASS (3 characters).

2. Where existent and known, 1:1 mappings to the deprecated SQLCODE are included.

3. In many cases, SQLCODE:SQLSTATE mappings are not 1:1, which is intentional on the part of the SQL Standards committee. It has been their aim, for many years, that the use of the SQLCODE be deprecated entirely.

SQLSTATE codeMapped messageMaps to SQLCODE..
SQLCLASS 00 (Success)
00000Success 
SQLCLASS 01 (Warning)
01000General warning 
01001Cursor operation conflict 
01002Disconnect error 
01003NULL value eliminated in set function 
01004String data, right-truncated 
01005Insufficient item descriptor areas 
01006Privilege not revoked 
01007Privilege not granted 
01008Implicit zero-bit padding 
01100Statement reset to unprepared 
01101Ongoing transaction has been committed 
01102Ongoing transaction has been rolled back 
SQLCLASS 02 (No data)
02000No data found or no rows affected 
SQLCLASS 07 (Dynamic SQL error)
07000Dynamic SQL error 
07001Wrong number of input parameters 
07002Wrong number of output parameters 
07003Cursor specification cannot be executed 
07004USING clause required for dynamic parameters 
07005Prepared statement not a cursor-specification 
07006Restricted data type attribute violation 
07007USING clause required for result fields 
07008Invalid descripto count 
07009Invalid descriptor index 
SQLCLASS 08 (Connection exception)
08001Client unable to establish connection 
08002Connection name in use 
08003Connection does not exist 
08004Server rejected the connection 
08006Connection failure 
08007Transaction resolution unknown 
SQLCLASS 0A (Feature not supported)
0A000Feature not supported 
SQLCLASS 0B (Invalid transaction initiation)
0B000Invalid transaction initiation 
SQLCLASS 0L (Invalid grantor)
0L000Invalid grantor 
SQLCLASS 0P (Invalid role specification)
0P000Invalid role specification 
SQLCLASS 0U (Attempt to assign to non-updatable column)
0U000Attempt to assign to non-updatable column 
SQLCLASS 0V (Attempt to assign to ordering column)
0V000Attempt to assign to ordering column 
SQLCLASS 20 (Case not found for case statement)
20000Case not found for case statement 
SQLCLASS 21 (Cardinality violation)
21000Cardinality violation 
21S01Insert value list does not match column list 
21S02Degree of derived table does not match column list 
SQLCLASS 22 (Data exception)
22000Data exception 
22001String data, right truncation 
22002Null value, no indicator parameter 
22003Numeric value out of range 
22004Null value not allowed 
2205Error in assignment 
2206Null value in field reference 
2207Invalid datetime format 
22008Datetime field overflow 
22009Invalid time zone displacement value 
2200ANull value in reference target 
2200BEscape character conflict 
2200CInvalid use of escape character 
2200DInvalid escape octet 
2200ENull value in array target 
2200FZero-length character string 
2200GMost specific type mismatch 
22010Invalid indicator parameter value 
22011Substring error 
22012Division by zero 
22014Invalid update value 
22015Interval field overflow 
22018Invalid character value for cast 
22019Invalid escape character 
2201BInvalid regular expression 
2201CNull row not permitted in table 
22020Invalid limit value 
22021Character not in repertoire 
22022Indicator overflow 
22023Invalid parameter value 
22024Character string not properly terminated 
22025Invalid escape sequence 
22026String data, length mismatch 
22027Trim error 
22028Row already exists 
2202DNull instance used in mutator function 
2202EArray element error 
2202FArray data, right truncation 
SQLCLASS 23 (Integrity constraint violation)
23000Integrity constraint violation 
SQLCLASS 24 (Invalid cursor state)
24000Invalid cursor state 
24504The cursor identified in the UPDATE, DELETE, SET, or GET statement is not positioned on a row 
SQLCLASS 25 (Invalid transaction state)
25000Invalid transaction state 
25xxxx 
25S01Transaction state 
25S02Transaction is still active 
25S03Transaction is rolled back 
SQLCLASS 26 (Invalid SQL statement name)
26000Invalid SQL statement name 
SQLCLASS 27 (Triggered data change violation)
27000Triggered data change violation 
SQLCLASS 28 (Invalid authorization specification)
28000Invalid authorization specification 
SQLCLASS 2B (Dependent privilege descriptors still exist)
2B000Dependent privilege descriptors still exist 
SQLCLASS 2C (Invalid character set name)
2C000Invalid character set name 
SQLCLASS 2D (Invalid transaction termination)
2D000Invalid transaction termination 
SQLCLASS 2E (Invalid connection name)
2E000Invalid connection name 
SQLCLASS 2F (SQL routine exception)
2F000SQL routine exception 
2F002Modifying SQL-data not permitted 
2F003Prohibited SQL-statement attempted 
2F004Reading SQL-data not permitted 
2F005Function executed no return statement 
SQLCLASS 33 (Invalid SQL descriptor name)
33000Invalid SQL descriptor name 
SQLCLASS 34 (Invalid cursor name)
34000Invalid cursor name 
SQLCLASS 35 (Invalid condition number)
35000Invalid condition number 
SQLCLASS 36 (Cursor sensitivity exception)
36001Request rejected 
36002Request failed 
SQLCLASS 37 (Invalid identifier)
37000Invalid identifier 
37001Identifier too long 
SQLCLASS 38 (External routine exception)
38000External routine exception 
SQLCLASS 39 (External routine invocation exception)
39000External routine invocation exception 
SQLCLASS 3B (Invalid save point)
3B000Invalid save point 
SQLCLASS 3C (Ambiguous cursor name)
3C000Ambiguous cursor name 
SQLCLASS 3D (Invalid catalog name)
3D000Invalid catalog name 
3D001Catalog name not found 
SQLCLASS 3F (Invalid schema name)
3F000Invalid schema name 
SQLCLASS 40 (Transaction rollback)
40000Ongoing transaction has been rolled back 
40001Serialization failure 
40002Transaction integrity constraint violation 
40003Statement completion unknown 
SQLCLASS 42 (Syntax error or access violation)
42000Syntax error or access violation 
42702Ambiguous column reference 
42725Ambiguous function reference 
42818The operands of an operator or function are not compatible 
42S01Base table or view already exists 
42S02Base table or view not found 
42S11Index already exists 
42S12Index not found 
42S21Column already exists 
42S22Column not found 
SQLCLASS 44 (With check option violation)
44000WITH CHECK OPTION violation 
SQLCLASS 45 (Unhandled user-defined exception)
45000Unhandled user-defined exception 
SQLCLASS 54 (Program limit exceeded)
54000Program limit exceeded 
54001Statement too complex 
54011Too many columns 
54023Too many arguments 
SQLCLASS HY (CLI-specific condition)
HY000CLI-specific condition 
HY001Memory allocation error 
HY003Invalid data type in application descriptor 
HY004Invalid data type 
HY007Associated statement is not prepared 
HY008Operation canceled 
HY009Invalid use of null pointer 
HY010Function sequence error 
HY011Attribute cannot be set now 
HY012Invalid transaction operation code 
HY013Memory management error 
HY014Limit on the number of handles exceeded 
HY015No cursor name available 
HY016Cannot modify an implementation row descriptor 
HY017Invalid use of an automatically allocated descriptor handle 
HY018Server declined the cancellation request 
HY019Non-string data cannot be sent in pieces 
HY020Attempt to concatenate a null value 
HY021Inconsistent descriptor information 
HY024Invalid attribute value 
HY055Non-string data cannot be used with string routine 
HY090Invalid string length or buffer length 
HY091Invalid descriptor field identifier 
HY092Invalid attribute identifier 
HY095Invalid FunctionId specified 
HY096Invalid information type 
HY097Column type out of range 
HY098Scope out of range 
HY099Nullable type out of range 
HY100Uniqueness option type out of range 
HY101Accuracy option type out of range 
HY103Invalid retrieval code 
HY104Invalid LengthPrecision value 
HY105Invalid parameter type 
HY106Invalid fetch orientation 
HY107Row value out of range 
HY109Invalid cursor position 
HY110Invalid driver completion 
HY111Invalid bookmark value 
HYC00Optional feature not implemented 
HYT00Timeout expired 
HYT01Connection timeout expired 
SQLCLASS XX (Internal error)
XX000Internal error 
XX001Data corrupted 
XX002Index corrupted 

back to top of page
<< Firebird 2.5 project teams | Firebird 2.5.3 Release Notes | B. License notice >>