SQL Exceptions

Range of Error Codes Type of Errors
-5100 to -5199 Query processing errors
-5200 to -5299 Data type and related (e.g. conversion) errors
-5300 to -5399 Constraints
-5400 to -5599 Index/storage errors
-5500 to -5599 Transaction errors
-5600 to -5699 Security/Authorization errors
-5700 to -5799 System catalog errors
-5800 to -5899 JDBC, RMI, Network and IO errors
-5900 to -5999 Other


SQL State and Error Messages

SQLState Error Code Error Message
Class SubClass
21 000 -5100 More than one tuple not allowed for the Subquery (Subquery returned more than 1 value. This is illegal when the subquery follows , , <, <=, >, >=. or when the subquery is used as an expression.)
S01 -5104 Insert Value list does not match the Column list
S02 -5105 Degree of the derived table does not match Column list
22 003 -5204 Numeric Value out of range
006 -5201 Invalid Interval Format
012 -5200 Divide by Zero Error
015 -5202 Interval field overflow
019 -5101 Invalid Escape character, Single character to be used
025 -5102 Invalid Escape Sequence
027 -5203 Trim Error
23 000 -5300 Unique key constraint violated ( Tuple already exists)
-5301 Unique key constraint violated ( Null value not permitted for primary keys)
42 000 -5600 User not authorized to access the table/view
-5601 User not authorized to access the column of table/view
-5602 User not authorized to grant permission for the table/view
S01 -5105 Table or View already exists
S02 -5103 Table or View not found
S11 -5400 Index already exists with the same name
S21 -5106 Column already exists with the same name
S22 -5107 Column not found or Invalid column name


Feel free to add the errors for which you want error codes to be supported:

  • Tuple already exists, for primary key insertion ( Now Suppported )