[转载]ODBC SQLState Codes

上一篇 / 下一篇  2007-11-22 10:57:18 / 个人分类:DataBase

TheSQLGetDiagRec andSQLGetDiagFieldfunctions returnSQLSTATEvalues as defined by X/Open Data Management: Structured Query Language (SQL), Version 2 (March 1995).
SQLSTATEvalues are strings that contain five characters. The following table listsSQLSTATEvalues that a driver can return forSQLGetDiagRec.
The character string value returned for anSQLSTATEconsists of a two-character class value followed by a three-character subclass value. A class value of01indicates a warning and is accompanied by a return code ofSQL_SUCCESS_WITH_INFO. Class values other than'01', except for the class'IM', indicate an error and are accompanied by a return code ofSQL_ERROR. The class'IM'is specific to warnings and errors that derive from the implementation of ODBC itself. The subclass value'000'in any class indicates that there is no subclass for thatSQLSTATE. The assignment of class and subclass values is defined by SQL-92.

Note: Although successful execution of a function is normally indicated by a return value ofSQL_SUCCESS, theSQLSTATE00000also indicates success.

SQLStateError
01001Cursor operation conflict
01002Disconnect error
01003NULL value eliminated in set function
01004String data, right truncated
01006Privilege not revoked
01007Privilege not granted
01S00Invalid connection string attribute
01S01Error in row
01S02Option value changed
01S06Attempt to fetch before the result set returned the first rowset
01S07Fractional truncation
01S08Error saving File DSN
01S09Invalid keyword
07002COUNT field incorrect
07005Prepared statement not a cursor-specification
07006Restricted data type attribute violation
07009Invalid descrīptor index
07S01Invalid use of default parameter
08001Client unable to establish connection
08002Connection name in use
08003Connection does not exist
08004Server rejected the connection
08007Connection failure during transaction
08S01Communication link failure
21S01Insert value list does not match column list
21S02Degree of derived table does not match column list
22001String data, right truncated
22002Indicator variable required but not supplied
22003Numeric value out of range
22007Invalid datetime format
22008Datetime field overflow
22012Division by zero
22015Interval field overflow
22018Invalid character value for cast specification
22019Invalid escape character
22025Invalid escape sequence
22026String data, length mismatch
23000Integrity constraint violation
24000Invalid cursor state
25000Invalid transaction state
25S01Transaction state
25S02Transaction is still active
25S03Transaction is rolled back
28000Invalid authorization specification
34000Invalid cursor name
3C000Duplicate cursor name
3D000Invalid catalog name
3F000Invalid schema name
40001Serialization failure
40003Statement completion unknown
42000Syntax error or access violation
42S01Base table or view already exists
42S02Base table or view not found
42S11Index already exists
42S12Index not found
42S21Column already exists
42S22Column not found
44000WITH CHECK OPTION violation
HY000General error
SQLErrorSQLGetDiagField
HY001Memory allocation error
SQLErrorSQLGetDiagField
HY003Invalid application buffer type
HY004Invalid SQL data type
HY007Associated statement is not prepared
HY008Operation canceled
SQLBulkOperationsSQLColAttribute
HY009Invalid use of null pointer
HY010Function sequence error
HY011Attribute cannot be set now
HY012Invalid transaction operation code
HY013Memory management error
SQLGetDiagFieldSQLGetDiagRec
HY014Limit on the number of handles exceeded
HY015No cursor name available
HY016Cannot modify an implementation row descrīptor
HY017Invalid use of an automatically allocated descrīptor handle
HY018Server declined cancel request
HY019Non-character and non-binary data sent in pieces
HY020Attempt to concatenate a null value
HY021Inconsistent descrīptor information
HY024Invalid attribute value
HY090Invalid string or buffer length
HY091Invalid descrīptor field identifier
HY092Invalid attribute/option identifier
HY093Invalid parameter number
HY095Function type out of range
HY096Invalid information type
HY097Column type out of range
HY098Scope type out of range
HY099Nullable type out of range
HY100Uniqueness option type out of range
HY101Accuracy option type out of range
HY103Invalid retrieval code
HY104Invalid precision or scale value
HY105Invalid parameter type
HY106Fetch type out of range
HY107Row value out of range
HY109Invalid cursor position
HY110Invalid driver completion
HY111Invalid bookmark value
HYC00Optional feature not implemented
HYT00Timeout expired
HYT01Connection timeout expired
SQLDriversSQLDataSources
IM001Driver does not support this function
SQLAllocHandleSQLDataSources
IM002Data source name not found and no default driver specified
IM003Specified driver could not be loaded
IM004Driver’s SQLAllocHandle on SQL_HANDLE_ENV failed
IM005Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed
IM006Driver’s SQLSetConnectAttr failed
IM007No data source or driver specified; dialog prohibited
IM008Dialog failed
IM009Unable to load translation DLL
IM010Data source name too long
IM011Driver name too long
IM012DRIVER keyword syntax error
IM013Trace file error
IM014Invalid name of File DSN
IM015Corrupt file data source


TAG: DataBase

 

评分:0

我来说两句

Open Toolbar