SQLSTATE error codes
Applies to: Databricks SQL
Databricks Runtime 12.2 and above
All error classes returned by Databricks are associated with a 5 character SQLSTATE
.
A SQLSTATE
is a SQL standard encoding for error conditions commonly used by JDBC
, ODBC
, and other client APIs.
A SQLSTATE
consists of two portions: A two character class, and a three character subclass.
Each character must be a digit '0'
to '9'
or 'A'
to 'Z'
.
While many SQLSTATE
values are prescribed by the SQL standard, others are common in the industry, specific to Spark, or Databricks.
Where necessary Spark and Databricks use the 'KD'
class and 'K**'
subclass ranges for custom SQLSTATEs.
The class 'XX'
is used for internal errors warranting a bug report.
For an ordered list of error classes see: Error handling in Databricks
Databricks uses the following SQLSTATE
classes:
Class 07
: dynamic SQL error
SQLSTATE | Description and issuing error conditions |
---|---|
| using clause does not match dynamic parameter specifications |
| The option specified on PREPARE or EXECUTE is not valid. |
Class 08
: connection exception
SQLSTATE | Description and issuing error conditions |
---|---|
| connection exception |
| SQL-client unable to establish SQL-connection |
| connection does not exist |
| connection failure |
| server busy |
Class 0A
: feature not supported
Class 0B
: invalid transaction initiation
SQLSTATE | Description and issuing error conditions |
---|---|
| invalid transaction initiation |
Class 0K
: resignal when handler not active
SQLSTATE | Description and issuing error conditions |
---|---|
| resignal when handler not active |
Class 0N
: SQL/XML mapping error
SQLSTATE | Description and issuing error conditions |
---|---|
| SQL/XML mapping error |
Class 21
: cardinality violation
SQLSTATE | Description and issuing error conditions |
---|---|
| cardinality violation |
| The same row of a table cannot be the target for more than one of an update, delete or insert operation. |
| Insert value list does not match column list |
Class 22
: data exception
Class 23
: integrity constraint violation
SQLSTATE | Description and issuing error conditions |
---|---|
| restrict violation |
| An insert or update value is null, but the column cannot contain null values. |
| A violation of the constraint imposed by a unique index or a unique constraint occurred. |
| The check constraint cannot be added, because the table contains rows that do not satisfy the constraint definition. |
| MERGE cardinality violation |
Class 25
: invalid transaction state
SQLSTATE | Description and issuing error conditions |
---|---|
| invalid transaction state |
Class 28
: invalid authorization specification
SQLSTATE | Description and issuing error conditions |
---|---|
| invalid authorization specification |
Class 2B
: dependent privilege descriptors still exist
SQLSTATE | Description and issuing error conditions |
---|---|
| dependent objects still exist |
Class 2D
: invalid transaction termination
SQLSTATE | Description and issuing error conditions |
---|---|
| SQL COMMIT or ROLLBACK are invalid in the current operating environment. |
| |
| Post commit hook failed. |
Class 35
: invalid condition number
SQLSTATE | Description and issuing error conditions |
---|---|
| invalid condition number |
Class 38
: external routine exception
SQLSTATE | Description and issuing error conditions |
---|---|
| external routine exception |
Class 39
: external routine invocation exception
SQLSTATE | Description and issuing error conditions |
---|---|
| external routine invocation exception |
Class 3D
: invalid catalog name
SQLSTATE | Description and issuing error conditions |
---|---|
| invalid catalog name |
Class 3F
: invalid schema name
SQLSTATE | Description and issuing error conditions |
---|---|
| invalid schema name |
Class 40
: transaction rollback
SQLSTATE | Description and issuing error conditions |
---|---|
| transaction rollback |
Class 42
: syntax error or access rule violation
Class 44
: with check option violation
SQLSTATE | Description and issuing error conditions |
---|---|
| with check option violation |
Class 46
: Java DDL 1
SQLSTATE | Description and issuing error conditions |
---|---|
| unresolved class name |
| unsupported feature |
| invalid column name |
Class 51
: Invalid Application State
SQLSTATE | Description and issuing error conditions |
---|---|
| Invalid Application State |
| An object cannot be used, because it has been marked inoperative. |
Class 53
: insufficient resources
SQLSTATE | Description and issuing error conditions |
---|---|
| insufficient resources |
| disk full |
| out of memory |
Class 54
: program limit exceeded
SQLSTATE | Description and issuing error conditions |
---|---|
| program limit exceeded |
| |
| The statement is too long or too complex. |
| The result string is too long. |
| too many arguments |
| Maximum depth of nested views was exceeded. |
| Maximum UDF count in query plan exceeded. |
| Maximum object count in session exceeded. |
Class 55
: object not in prerequisite state
SQLSTATE | Description and issuing error conditions |
---|---|
| object not in prerequisite state |
| |
| The object is in an invalid state for the operation. |
Class 56
: Miscellaneous SQL or Product Error
Class 57
: operator intervention
SQLSTATE | Description and issuing error conditions |
---|---|
| operator intervention |
| A non-database resource is not available. This will not affect the successful execution of subsequent statements. |
| Query execution timeout |
Class 58
: System error
SQLSTATE | Description and issuing error conditions |
---|---|
| System error |
| I/O error |
Class 82
: out of memory
SQLSTATE | Description and issuing error conditions |
---|---|
| out of memory (could not allocate) |
Class F0
: configuration file error
SQLSTATE | Description and issuing error conditions |
---|---|
| configuration file error |
Class HV
: FDW-specific condition
SQLSTATE | Description and issuing error conditions |
---|---|
| FDW-specific condition |
| invalid descriptor field identifier |
Class HY
: CLI-specific condition
SQLSTATE | Description and issuing error conditions |
---|---|
| CLI-specific condition |
| operation canceled |
| invalid cursor position |
Class KD
: datasource specific errors
Class P0
: procedural logic error
SQLSTATE | Description and issuing error conditions |
---|---|
| raise exception |