meta data for this page
  •  

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 code Mapped message Maps to SQLCODE..

SQLCLASS 00 (Success)

0000 Success

SQLCLASS 01 (Warning)

01000 General warning
01001 Cursor operation conflict
01002 Disconnect error
01003 NULL value eliminated in set function
01004 String data, right-truncated
01005 Insufficient item descriptor areas
01006 Privilege not revoked
01007 Privilege not granted
01008 Implicit zero-bit padding
01100 Statement reset to unprepared
01101 Ongoing transaction has been committed
01102 Ongoing transaction has been rolled back

SQLCLASS 02 (No data)

02000 No data found or no rows affected

SQLCLASS 07 (Dynamic SQL error)

07000 Dynamic SQL error
07001 Wrong number of input parameters
07002 Wrong number of output parameters
07003 Cursor specification cannot be executed
07004 USING clause required for dynamic parameters
07005 Prepared statement not a cursor-specification
07006 Restricted data type attribute violation
07007 USING clause required for result fields
07008 Invalid descripto count
07009 Invalid descriptor index

SQLCLASS 08 (Connection exception)

08001 Client unable to establish connection
08002 Connection name in use
08003 Connection does not exist
08004 Server rejected the connection
08006 Connection failure
08007 Transaction resolution unknown

SQLCLASS 0A (Feature not supported)

0A000 Feature not supported

SQLCLASS 0B (Invalid transaction initiation)

0B000 Invalid transaction initiation

SQLCLASS 0L (Invalid grantor)

0L000 Invalid grantor

SQLCLASS 0P (Invalid role specification)

0P000 Invalid role specification

SQLCLASS 0U (Attempt to assign to non-updatable column)

0U000 Attempt to assign to non-updatable column

SQLCLASS 0V (Attempt to assign to ordering column)

0V000 Attempt to assign to ordering column

SQLCLASS 20 (Case not found for case statement)

20000 Case not found for case statement

SQLCLASS 21 (Cardinality violation)

21000 Cardinality violation
21S01 Insert value list does not match column list
21S02 Degree of derived table does not match column list

SQLCLASS 22 (Data exception)

22000 Data exception
22001 String data, right truncation
22002 Null value, no indicator parameter
22003 Numeric value out of range
22004 Null value not allowed
2205 Error in assignment
2206 Null value in field reference
2207 Invalid datetime format
22008 Datetime field overflow
22009 Invalid time zone displacement value
2200A Null value in reference target
2200B Escape character conflict
2200C Invalid use of escape character
2200D Invalid escape octet
2200E Null value in array target
2200F Zero-length character string
2200G Most specific type mismatch
22010 Invalid indicator parameter value
22011 Substring error
22012 Division by zero
22014 Invalid update value
22015 Interval field overflow
22018 Invalid character value for cast
22019 Invalid escape character
2201B Invalid regular expression
2201C Null row not permitted in table
22020 Invalid limit value
22021 Character not in repertoire
22022 Indicator overflow
22023 Invalid parameter value
22024 Character string not properly terminated
22025 Invalid escape sequence
22026 String data, length mismatch
22027 Trim error
22028 Row already exists
2202D Null instance used in mutator function
2202E Array element error
2202F Array data, right truncation
SQLCLASS 23 (Integrity constraint violation) SQLCLASS 23 (Integrity constraint violation) SQLCLASS 23 (Integrity constraint violation)
23000 Integrity constraint violation

SQLCLASS 23 (Integrity constraint violation)

23000 Integrity constraint violation

SQLCLASS 24 (Invalid cursor state)

24000 Invalid cursor state
24504 The cursor identified in the UPDATE, DELETE, SET, or GET statement is not positioned on a row

SQLCLASS 25 (Invalid transaction state)

25000 Invalid transaction state
25 xxxx
25S01 Transaction state
25S02 Transaction is still active
25S03 Transaction is rolled back

SQLCLASS 26 (Invalid SQL statement name)

26000 Invalid SQL statement name

SQLCLASS 27 (Triggered data change violation)

27000 Triggered data change violation

SQLCLASS 28 (Invalid authorization specification)

28000 Invalid authorization specification

SQLCLASS 2B (Dependent privilege descriptors still exist)

2B000 Dependent privilege descriptors still exist

SQLCLASS 2C (Invalid character set name)

2C000 Invalid character set name

SQLCLASS 2D (Invalid transaction termination)

2D000 Invalid transaction termination

SQLCLASS 2E (Invalid connection name)

2E000 Invalid connection name

SQLCLASS 2F (SQL routine exception)

2F000 SQL routine exception
2F002 Modifying SQL-data not permitted
2F003 Prohibited SQL-statement attempted
2F004 Reading SQL-data not permitted
2F005 Function executed no return statement

SQLCLASS 33 (Invalid SQL descriptor name)

33000 Invalid SQL descriptor name

SQLCLASS 34 (Invalid cursor name)

34000 Invalid cursor name

SQLCLASS 35 (Invalid condition number)

35000 Invalid condition number

SQLCLASS 36 (Cursor sensitivity exception)

36001 Request rejected
36002 Request failed

SQLCLASS 37 (Invalid identifier)

37000 Invalid identifier
37001 Identifier too long

SQLCLASS 38 (External routine exception)

38000 External routine exception

SQLCLASS 39 (External routine invocation exception)

39000 External routine invocation exception

SQLCLASS 3B (Invalid save point)

3B000 Invalid save point

SQLCLASS 3C (Ambiguous cursor name)

3C000 Ambiguous cursor name

SQLCLASS 3D (Invalid catalog name)

3D000 Invalid catalog name
3D001 Catalog name not found

SQLCLASS 3F (Invalid schema name)

3F000 Invalid schema name

SQLCLASS 40 (Transaction rollback)

40000 Ongoing transaction has been rolled back
40001 Serialization failure
40002 Transaction integrity constraint violation
40003 Statement completion unknown

SQLCLASS 42 (Syntax error or access violation)

40000 Ongoing transaction has been rolled back
40001 Serialization failure
40002 Transaction integrity constraint violation
40003 Statement completion unknown

SQLCLASS 44 (With check option violation)

44000 WITH CHECK OPTION violation

SQLCLASS 45 (Unhandled user-defined exception)

45000 Unhandled user-defined exception

SQLCLASS 54 (Program limit exceeded)

54000 Program limit exceeded
54001 Statement too complex
54011 Too many columns
54023 Too many arguments

SQLCLASS HY (CLI-specific condition)

HY000 CLI-specific condition
HY001 Memory allocation error
HY003 Invalid data type in application descriptor
HY004 Invalid data type
HY007 Associated statement is not prepared
HY008 Operation canceled
HY009 Invalid use of null pointer
HY010 Function sequence error
HY011 Attribute cannot be set now
HY012 Invalid transaction operation code
HY013 Memory management error
HY014 Limit on the number of handles exceeded
HY015 No cursor name available
HY016 Cannot modify an implementation row descriptor
HY017 Invalid use of an automatically allocated descriptor handle
HY018 Server declined the cancellation request
HY019 Non-string data cannot be sent in pieces
HY020 Attempt to concatenate a null value
HY021 Inconsistent descriptor information
HY024 Invalid attribute value
HY055 Non-string data cannot be used with string routine
HY090 Invalid string length or buffer length
HY091 Invalid descriptor field identifier
HY092 Invalid attribute identifier
HY095 Invalid FunctionId specified
HY096 Invalid information type
HY097 Column type out of range
HY098 Scope out of range
HY099 Nullable type out of range
HY100 Uniqueness option type out of range
HY101 Accuracy option type out of range
HY103 Invalid retrieval code
HY104 Invalid LengthPrecision value
HY105 Invalid parameter type
HY106 Invalid fetch orientation
HY107 Row value out of range
HY109 Invalid cursor position
HY110 Invalid driver completion
HY111 Invalid bookmark value
HYC00 Optional feature not implemented
HYT00 Timeout expired
HYT01 Connection timeout expired

SQLCLASS XX (Internal error)

XX000 Internal error
XX001 Data corrupted
XX002 Index corrupted