According to the definitions in the X/open and SQL access group SQL CAE specifications (1992), sqlerror returns the sqlstate value. The sqlstate value is a string containing five characters. The following table lists the drivers.ProgramIt can be the sqlstate value returned by sqlerror.
The string value returned for sqlstate is composed of two character class values followed by three character subclass values. Class value 01 indicates a warning followed by SQL _success_with_infoCode. As long as the class value is not 01 (except IM), it indicates that it is an error, followed by the return code of SQL _error. Class IM is used to indicate warnings and errors generated from ODBC implementations. The subclass value 000 in any class is used to implement the conditions defined in the given class. The Assignment Method for this type value and subclass value is defined by the SQL-92.
The return value SQL _success usually indicates that a function is successfully executed, but sqlstate 00000 also indicates that the function is successfully executed.
Sqlstate odbc api (driver manager) Error
00000 successful
01000 general warning
01002 disconnection Error
01004 data truncated
01006 remove privileges
01s00 invalid connection string feature
Error in line 01s01
01s02 option value changed
01s03 no row updated or deleted
01s04 updated or deleted multiple rows
01s05 canceled as freestmt/close
01s06 try to extract before the result returns the first row set
07001 Incorrect Parameter count
07006 violation of Restricted Data Types
07s01 the default parameter usage is invalid.
08001 unable to connect to the data source
08002 connection in use
08003 connection not opened
08004 the data source rejects connection Establishment
08007 connection failed during transaction execution
08s01 communication link failed
21s01 the inserted Value List does not match the column list
The degree of the 21s02 derived table does not match the column list
22001 right truncation of string data
22002 indicator variables are required, but no
22003 numeric value out of range
22005 Allocation Error
22008 datetime field Overflow
22012 zero Division Error
22026 string data, length Mismatch
23000 violation of integrity constraints
24000 * The cursor status is invalid.
25000 invalid transaction status
28000 invalid authorization Specification
34000 the cursor name is invalid.
37000 syntax error or illegal access
Duplicate 3c000 cursor name
40001 serial errors
42000 syntax error or illegal access
70100 operation termination
Im001 driver does not support this function
Im002 source name not found and default driver not specified
Im003 cannot load the specified driver
Sqlallocenv of im004 driver failed
Sqlallocconnect of im005 driver failed
Sqlsetconnectoption of the im006 driver failed
Im007 no data source or driver specified; Disable Dialog
Im008 dialog failed
Im009 cannot load the conversion DLL
Im010 the data source name is too long
Im011 driver name is too long
Im012 driver keyword syntax error
Im013 trace file Error
S0001 base table or view already exists
S0002 no base table found
S0011 index already exists
S0012 index not found
Column s0021 already exists
Column s0022 not found
No default value for column s0023
S1000 common error
An error occurred while allocating the memory of the specified instance.
The number of the column in the column '100' is invalid.
The number of the program types in the specified value is exceeded.
The data type of the SQL statement is out of the range.
The operation has been canceled for s1008.
The parameter value of s1009 is invalid.
S1010 function sequence error
The s1011 operation is invalid at this time.
The transaction operation code specified by s1012 is invalid.
S1015 no available cursor name
Invalid s1090 string or buffer Length
S1091 descriptor type out of range
S1092 option type out of range
The s1093 parameter number is invalid.
The s1094 decimal point value is invalid.
The s1095 function type is out of range.
S1096 information type out of range
The s1097 column type exceeds the range.
S1098 scope type out of range
S1099 can be empty type out of range
S1100 unique option type out of range
S1101 accuracy option type out of range
S1103 direction option out of range
The s1104 precision value is invalid.
The s1105 parameter type is invalid.
S1106 extraction type out of range
The value of s1107 row exceeds the range.
The s1108 concurrency option is out of range
The cursor position of s1109 is invalid.
Invalid s1110 driver completion
The s1111 bookmarks are invalid.
S1c00 driver cannot be executed
S1de0 execution value suspended without data
S1t00 expired
A very detailed summary of error codes, hoping to help you