ODBC Status Return Codes SQLSTATE 01| SQLSTATE | Error | Can be returned from |
|---|
| 01000 | General warning | | | 01001 | Cursor operation conflict | - SQLExecDirect
StatementText contained a positioned update or delete statement, and no rows or more than one row were updated or deleted. (For more information about updates to more than one row, see the description of the SQL_ATTR_SIMULATE_CURSOR Attribute in SQLSetStmtAttr.) (Function returns SQL_SUCCESS_WITH_INFO) - SQLExecute
The prepared statement associated with the StatementHandle contained a positioned update or delete statement, and no rows or more than one row were updated or deleted. (For more information about updates to more than one row, see the description of the SQL_ATTR_SIMULATE_CURSOR Attribute in SQLSetStmtAttr.) (Function returns SQL_SUCCESS_WITH_INFO.) - SQLParamData
- SQLSetPos
The Operation argument was SQL_DELETE or SQL_UPDATE, and no rows or more than one row were deleted or updated. (For more information about updates to more than one row, see the description of the SQL_ATTR_SIMULATE_CURSOR Attribute in SQLSetStmtAttr.) (Function returns SQL_SUCCESS_WITH_INFO.) The Operation argument was SQL_DELETE or SQL_UPDATE, and the operation failed because of optimistic concurrency. (Function returns SQL_SUCCESS_WITH_INFO.)
| | 01002 | Disconnect error | | | 01003 | NULL value eliminated in set function | - SQLExecDirect
The argument StatementText contained a set function (such as AVG, MAX, MIN, and so on), but not the COUNT set function, and NULL argument values were eliminated before the function was applied. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExecute
The prepared statement associated with StatementHandle contained a set function (such as AVG, MAX, MIN, and so on), but not the COUNT set function, and NULL argument values were eliminated before the function was applied. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLParamData
| | 01004 | String data, right-truncated | - SQLBrowseConnect
The buffer *OutConnectionString was not large enough to return the entire browse result connection string, so the string was truncated. The buffer *StringLength2Ptr contains the length of the untruncated browse result connection string. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLBulkOperations
The Operation argument was SQL_FETCH_BY_BOOKMARK, and string or binary data returned for a column or columns with a data type of SQL_C_CHAR or SQL_C_BINARY resulted in the truncation of nonblank character or non-NULL binary data. - SQLColAttribute
The buffer *CharacterAttributePtr was not large enough to return the entire string value, so the string value was truncated. The length of the untruncated string value is returned in *StringLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLDataSources
(DM) The buffer *ServerName was not large enough to return the entire data source name, so the name was truncated. The length of the entire data source name is returned in *NameLength1Ptr. (Function returns SQL_SUCCESS_WITH_INFO.) (DM) The buffer *Description was not large enough to return the entire driver description, so the description was truncated. The length of the untruncated data source description is returned in *NameLength2Ptr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLDescribeCol
The buffer *ColumnName was not large enough to return the entire column name, so the column name was truncated. The length of the untruncated column name is returned in *NameLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLDriverConnect
The buffer *OutConnectionString was not large enough to return the entire connection string, so the connection string was truncated. The length of the untruncated connection string is returned in *StringLength2Ptr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLDrivers
(DM) The buffer *DriverDescription was not large enough to return the entire driver description, so the description was truncated. The length of the entire driver description is returned in *DescriptionLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) (DM) The buffer *DriverAttributes was not large enough to return the entire list of attribute value pairs, so the list was truncated. The length of the untruncated list of attribute value pairs is returned in *AttributesLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExecDirect
String or binary data returned for an input/output or output parameter resulted in the truncation of nonblank character or non-NULL binary data. If it was a string value, it was right-truncated. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExecute
String or binary data returned for an output parameter resulted in the truncation of nonblank character or non-NULL binary data. If it was a string value, it was right-truncated. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExtendedFetch
String or binary data returned for a column resulted in the truncation of nonblank character or non-NULL binary data. If it was a string value, it was right-truncated. If it was a numeric value, the fractional part of the number was truncated. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLFetch
String or binary data returned for a column resulted in the truncation of nonblank character or non-NULL binary data. If it was a string value, it was right-truncated. - SQLFetchScroll
String or binary data returned for a column resulted in the truncation of nonblank character or non-NULL binary data. String values are right-truncated. - SQLGetConnectAttr
The data returned in *ValuePtr was truncated to be BufferLength minus the length of a null-termination character. The length of the untruncated string value is returned in *StringLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLGetCursorName
The buffer *CursorName was not large enough to return the entire cursor name, so the cursor name was truncated. The length of the untruncated cursor name is returned in *NameLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLGetData
Not all of the data for the specified column, ColumnNumber, could be retrieved in a single call to the function. The length of the data remaining in the specified column prior to the current call to SQLGetData is returned in *StrLen_or_IndPtr. (Function returns SQL_SUCCESS_WITH_INFO.) The TargetValuePtr argument was a null pointer, and more data was available to return. (Function returns SQL_SUCCESS_WITH_INFO.) For more information on using multiple calls to SQLGetData> for a single column, see "Comments." - SQLGetDescField
The buffer *ValuePtr was not large enough to return the entire descriptor field, so the field was truncated. The length of the untruncated descriptor field is returned in *StringLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLGetDescRec
The buffer *Name was not large enough to return the entire descriptor field, so the field was truncated. The length of the untruncated descriptor field is returned in *StringLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLGetEnvAttr
The data returned in *ValuePtr was truncated to be BufferLength minus the null-termination character. The length of the untruncated string value is returned in *StringLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLGetInfo
The buffer *InfoValuePtr was not large enough to return all of the requested information, so the information was truncated. The length of the requested information in its untruncated form is returned in *StringLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLGetStmtAttr
The data returned in *ValuePtr was truncated to be BufferLength minus the length of a null-termination character. The length of the untruncated string value is returned in *StringLengthPtr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLNativeSql
The buffer *OutStatementText was not large enough to return the entire SQL string, so the SQL string was truncated. The length of the untruncated SQL string is returned in *TextLength2Ptr. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLParamData
- SQLPutData
String or binary data returned for an output parameter resulted in the truncation of nonblank character or non-NULL binary data. If it was a string value, it was right-truncated. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLSetCursorName
The cursor name exceeded the maximum limit, so only the maximum allowable number of characters was used. - SQLSetPos
The Operation argument was SQL_REFRESH, and string or binary data returned for a column or columns with a data type of SQL_C_CHAR or SQL_C_BINARY resulted in the truncation of nonblank character or non-NULL binary data.
| | 01006 | Privilege not revoked | - SQLExecDirect
*StatementText contained a REVOKE statement, and the user did not have the specified privilege. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExecute
The prepared statement associated with the StatementHandle was a REVOKE statement, and the user did not have the specified privilege. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLParamData
| | 01007 | Privilege not granted | - SQLExecDirect
*StatementText was a GRANT statement, and the user could not be granted the specified privilege. - SQLExecute
The prepared statement associated with the StatementHandle was a GRANT statement, and the user could not be granted the specified privilege. - SQLParamData
| | 01S00 | Invalid connection string attribute | - SQLBrowseConnect
An invalid attribute keyword was specified in the browse request connection string (InConnectionString). (Function returns SQL_NEED_DATA.) An attribute keyword was specified in the browse request connection string (InConnectionString) that does not apply to the current connection level. (Function returns SQL_NEED_DATA.) - SQLDriverConnect
An invalid attribute keyword was specified in the connection string (InConnectionString), but the driver was able to connect to the data source anyway. (Function returns SQL_SUCCESS_WITH_INFO.)
| | 01S01 | Error in row | - SQLBulkOperations
The Operation argument was SQL_ADD, and an error occurred in one or more rows while performing the operation but at least one row was successfully added. (Function returns SQL_SUCCESS_WITH_INFO.) (This error is raised only when an application is working with an ODBC 2.x driver.) - SQLExtendedFetch
An error occurred while fetching one or more rows. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLFetch
An error occurred while fetching one or more rows. (If this SQLSTATE is returned when an ODBC 3.x application is working with an ODBC 2.x driver, it can be ignored.) - SQLFetchScroll
An error occurred while fetching one or more rows. (This SQLSTATE is returned only by ODBC 2.x drivers.) - SQLSetPos
The RowNumber argument was 0, and an error occurred in one or more rows while performing the operation specified with the Operation argument. (SQL_SUCCESS_WITH_INFO is returned if an error occurs on one or more, but not all, rows of a multirow operation, and SQL_ERROR is returned if an error occurs on a single-row operation.) (This SQLSTATE is returned only when SQLSetPos is called after SQLExtendedFetch, if the driver is an ODBC 2.x driver and the cursor library is not used.)
| | 01S02 | Option value changed | - SQLBrowseConnect
The driver did not support the specified value of the ValuePtr argument in SQLSetConnectAttr and substituted a similar value. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLConnect
The driver did not support the specified value of the ValuePtr argument in SQLSetConnectAttr and substituted a similar value. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLDriverConnect
The driver did not support the specified value pointed to by the ValuePtr argument in SQLSetConnectAttr and substituted a similar value. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExecDirect, SQLExecute, SQLGetTypeInfo
A specified statement attribute was invalid because of implementation working conditions, so a similar value was temporarily substituted. ( SQLGetStmtAttr can be called to determine what the temporarily substituted value is.) The substitute value is valid for the StatementHandle until the cursor is closed, at which point the statement attribute reverts to its previous value. The statement attributes that can be changed are: SQL_ATTR_CONCURRENCY SQL_ATTR_CURSOR_TYPE SQL_ATTR_KEYSET_SIZE SQL_ATTR_MAX_LENGTH SQL_ATTR_MAX_ROWS SQL_ATTR_QUERY_TIMEOUT SQL_ATTR_SIMULATE_CURSOR Function returns SQL_SUCCESS_WITH_INFO.) - SQLMoreResults
The value of a statement attribute changed as the batch was being processed. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLParamData
- SQLPrepare
A specified statement attribute was invalid because of implementation working conditions, so a similar value was temporarily substituted. (SQLGetStmtAttr can be called to determine what the temporarily substituted value is.) The substitute value is valid for the StatementHandle until the cursor is closed. The statement attributes that can be changed are: SQL_ATTR_CONCURRENCY SQL_ATTR_CURSOR_TYPE SQL_ATTR_KEYSET_SIZE SQL_ATTR_MAX_LENGTH SQL_ATTR_MAX_ROWS SQL_ATTR_QUERY_TIMEOUT SQL_ATTR_SIMULATE_CURSOR (Function returns SQL_SUCCESS_WITH_INFO.) - SQLSetConnectAttr
The driver did not support the value specified in ValuePtr and substituted a similar value. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLSetDescField
The driver did not support the value specified in *ValuePtr (if ValuePtr was a pointer) or the value in ValuePtr (if ValuePtr was a 4-byte value), or *ValuePtr was invalid because of implementation working conditions, so the driver substituted a similar value. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLSetEnvAttr
The driver did not support the value specified in ValuePtr and substituted a similar value. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLSetStmtAttr
The driver did not support the value specified in ValuePtr, or the value specified in ValuePtr was invalid because of implementation working conditions, so the driver substituted a similar value. (SQLGetStmtAttr can be called to determine the temporarily substituted value.) The substitute value is valid for the StatementHandle until the cursor is closed, at which point the statement attribute reverts to its previous value. The statement attributes that can be changed are: SQL_ATTR_CONCURRENCY SQL_ATTR_CURSOR_TYPE SQL_ATTR_KEYSET_SIZE SQL_ATTR_MAX_LENGTH SQL_ATTR_MAX_ROWS SQL_ATTR_QUERY_TIMEOUT SQL_ATTR_ROW_ARRAY_SIZE SQL_ATTR_SIMULATE_CURSOR (Function returns SQL_SUCCESS_WITH_INFO.)
| | 01S06 | Attempt to fetch before the result set returned the first rowset | - SQLExtendedFetch
The requested rowset overlapped the start of the result set when the current position was beyond the first row, and either FetchOrientation was SQL_PRIOR or FetchOrientation was SQL_RELATIVE with a negative FetchOffset whose absolute value was less than or equal to the current SQL_ROWSET_SIZE. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLFetchScroll
The requested rowset overlapped the start of the result set when FetchOrientation was SQL_FETCH_PRIOR, the current position was beyond the first row, and the number of the current row is less than or equal to the rowset size. The requested rowset overlapped the start of the result set when FetchOrientation was SQL_FETCH_PRIOR, the current position was beyond the end of the result set, and the rowset size was greater than the result set size. The requested rowset overlapped the start of the result set when FetchOrientation was SQL_FETCH_RELATIVE, FetchOffset was negative, and the absolute value of FetchOffset was less than or equal to the rowset size. The requested rowset overlapped the start of the result set when FetchOrientation was SQL_FETCH_ABSOLUTE, FetchOffset was negative, and the absolute value of FetchOffset was greater than the result set size but less than or equal to the rowset size. (Function returns SQL_SUCCESS_WITH_INFO.)
| | 01S07 | Fractional truncation | - SQLBulkOperations
The Operation argument was SQL_FETCH_BY_BOOKMARK, the data type of the application buffer was not SQL_C_CHAR or SQL_C_BINARY, and the data returned to application buffers for one or more columns was truncated. (For numeric C data types, the fractional part of the number was truncated. For time, timestamp, and interval C data types containing a time component, the fractional portion of the time was truncated.) (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExecDirect, SQLExecute
The data returned for an input/output or output parameter was truncated such that the fractional part of a numeric data type was truncated or the fractional portion of the time component of a time, timestamp, or interval data type was truncated. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExtendedFetch, SQLFetch, SQLFetchScroll
The data returned for a column was truncated. For numeric data types, the fractional part of the number was truncated. For time, timestamp, and interval data types containing a time component, the fractional portion of the time was truncated. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLGetData
The data returned for one or more columns was truncated. For numeric data types, the fractional part of the number was truncated. For time, timestamp, and interval data types containing a time component, the fractional portion of the time was truncated. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLParamData
- SQLSetPos
The Operation argument was SQL_REFRESH, the data type of the application buffer was not SQL_C_CHAR or SQL_C_BINARY, and the data returned to application buffers for one or more columns was truncated. For numeric data types, the fractional part of the number was truncated. For time, timestamp, and interval data types containing a time component, the fractional portion of the time was truncated. (Function returns SQL_SUCCESS_WITH_INFO.)
| | 01S08 | Error saving File DSN | | | 01S09 | Invalid keyword | | 
SQLSTATE 07| SQLSTATE | Error | Can be returned from |
|---|
| 07001 | Wrong number of parameters | | | 07002 | COUNT field incorrect | - SQLExecDirect, SQLExecute
The number of parameters specified in SQLBindParameter was less than the number of parameters in the SQL statement contained in *StatementText. SQLBindParameter was called with ParameterValuePtr set to a null pointer, StrLen_or_IndPtr not set to SQL_NULL_DATA or SQL_DATA_AT_EXEC, and InputOutputType not set to SQL_PARAM_OUTPUT, so that the number of parameters specified in SQLBindParameter was greater than the number of parameters in the SQL statement contained in *StatementText. - SQLParamData
| | 07005 | Prepared statement not a cursor-specification | - SQLColAttribute
The statement associated with the StatementHandle did not return a result set and FieldIdentifier was not SQL_DESC_COUNT. There were no columns to describe. - SQLDescribeCol
The statement associated with the StatementHandle did not return a result set. There were no columns to describe.
| | 07006 | Restricted data type attribute violation | - SQLBindCol
(DM) The ColumnNumber argument was 0, and the TargetType argument was not SQL_C_BOOKMARK or SQL_C_VARBOOKMARK. - SQLBindParameter
The data type identified by the ValueType argument cannot be converted to the data type identified by the ParameterType argument. Note that this error may be returned by SQLExecDirect, SQLExecute, or SQLPutData at execution time, instead of by SQLBindParameter. - SQLBulkOperations
The Operation argument was SQL_FETCH_BY_BOOKMARK, and the data value of a column in the result set could not be converted to the data type specified by the TargetType argument in the call to SQLBindCol. The Operation argument was SQL_UPDATE_BY_BOOKMARK or SQL_ADD, and the data value in the application buffers could not be converted to the data type of a column in the result set. - SQLExecDirect, SQLExecute
The data value identified by the ValueType argument in SQLBindParameter for the bound parameter could not be converted to the dataSQLBindParameter. The data value returned for a parameter bound as SQL_PARAM_INPUT_OUTPUT or SQL_PARAM_OUTPUT could not be converted to the data type identified by the ParameterType argument in SQLBindParameter. (If the data values for one or more rows could not be converted but one or more rows were successfully returned, this function returns SQL_SUCCESS_WITH_INFO.) - SQLExtendedFetch
A data value could not be converted to the C data type specified by TargetType in SQLBindCol. - SQLFetch, SQLFetchScroll
The data value of a column in the result set could not be converted to the data type specified by TargetType in SQLBindCol. Column 0 was bound with a data type of SQL_C_BOOKMARK, and the SQL_ATTR_USE_BOOKMARKS statement attribute was set to SQL_UB_VARIABLE. Column 0 was bound with a data type of SQL_C_VARBOOKMARK, and the SQL_ATTR_USE_BOOKMARKS statement attribute was not set to SQL_UB_VARIABLE. - SQLGetData
The data value of a column in the result set cannot be converted to the C data type specified by the argument TargetType. - SQLParamData
The data value identified by the ValueType argument in SQLBindParameter for the bound parameter could not be converted to the data type identified by the ParameterType argument in SQLBindParameter. The data value returned for a parameter bound as SQL_PARAM_INPUT_OUTPUT or SQL_PARAM_OUTPUT could not be converted to the data type identified by the ValueType argument in SQLBindParameter. (If the data values for one or more rows could not be converted, but one or more rows were successfully returned, this function returns SQL_SUCCESS_WITH_INFO.) - SQLPutData
The data value identified by the ValueType argument in SQLBindParameter for the bound parameter could not be converted to the data type identified by the ParameterType argument in SQLBindParameter. - SQLSetPos
The data value of a column in the result set could not be converted to the data type specified by TargetType in the call to SQLBindCol.
| | 07009 | Invalid descriptor index | - SQLBindCol
The value specified for the argument ColumnNumber exceeded the maximum number of columns in the result set. - SQLBindParameter
(DM) The value specified for the argument ParameterNumber was less than 1. - SQLBulkOperations
The argument Operation was SQL_ADD, and a column was bound with a column number greater than the number of columns in the result set. - SQLColAttribute, SQLDescribeCol
(DM) The value specified for the argument ColumnNumber was equal to 0, and the SQL_ATTR_USE_BOOKMARKS statement option was SQL_UB_OFF. The value specified for the argument ColumnNumber was greater than the number of columns in the result set. - SQLDescribeParam
(DM) The value specified for the argument ParameterNumber is less than 1. The value specified for the argument ParameterNumber was greater than the number of parameters in the associated SQL statement. The parameter marker was part of a non-DML statement. The parameter marker was part of a SELECT list. - SQLExtendedFetch
Column 0 was bound with SQLBindCol, and the SQL_ATTR_USE_BOOKMARKS statement attribute was set to SQL_UB_OFF. - SQLFetch
The driver was an ODBC 2.x driver that does not support SQLExtendedFetch, and a column number specified in the binding for a column was 0. Column 0 was bound, and the SQL_ATTR_USE_BOOKMARKS statement attribute was set to SQL_UB_OFF. - SQLFetchScroll
Column 0 was bound, and the SQL_ATTR_USE_BOOKMARKS statement attribute was set to SQL_UB_OFF. - SQLGetData
The value specified for the argument ColumnNumber was 0, and the SQL_ATTR_USE_BOOKMARKS statement attribute was set to SQL_UB_OFF. The value specified for the argument ColumnNumber was greater than the number of columns in the result set. (DM) The specified column was bound. This description does not apply to drivers that return the SQL_GD_BOUND bitmask for the SQL_GETDATA_EXTENSIONS option in SQLGetInfo. (DM) The number of the specified column was less than or equal to the number of the highest bound column. This description does not apply to drivers that return the SQL_GD_ANY_COLUMN bitmask for the SQL_GETDATA_EXTENSIONS option in SQLGetInfo. (DM) The application has already called SQLGetData for the current row; the number of the column specified in the current call was less than the number of the column specified in the preceding call; and the driver does not return the SQL_GD_ANY_ORDER bitmask for the SQL_GETDATA_EXTENSIONS option in SQLGetInfo. (DM) The TargetType argument was SQL_ARD_TYPE, and the ColumnNumber descriptor record in the ARD failed the consistency check. (DM) The TargetType argument was SQL_ARD_TYPE, and the value in the SQL_DESC_COUNT field of the ARD was less than the ColumnNumber argument. - SQLGetDescField
(DM) The RecNumber argument was equal to 0, the SQL_ATTR_USE_BOOKMARK statement attribute was SQL_UB_OFF, and the DescriptorHandle argument was an IRD handle. (This error can be returned for an explicitly allocated descriptor only if the descriptor is associated with a statement handle.) The FieldIdentifier argument was a record field, the RecNumber argument was 0, and the DescriptorHandle argument was an IPD handle. The RecNumber argument was less than 0. - SQLGetDescRec
The FieldIdentifier argument was a record field, the RecNumber argument was set to 0, and the DescriptorHandle argument was an IPD handle. (DM) The RecNumber argument was set to 0, and the SQL_ATTR_USE_BOOKMARKS statement attribute was set to SQL_UB_OFF, and the DescriptorHandle argument was an IRD handle. The RecNumber argument was less than 0. - SQLParamData
- SQLSetDescField
The FieldIdentifier argument was a record field, the RecNumber argument was 0, and the DescriptorHandle argument referred to an IPD handle. The RecNumber argument was less than 0, and the DescriptorHandle argument referred to an ARD or an APD. The RecNumber argument was greater than the maximum number of columns or parameters that the data source can support, and the DescriptorHandle argument referred to an APD or ARD. (DM) The FieldIdentifier argument was SQL_DESC_COUNT, and *ValuePtr argument was less than 0. The RecNumber argument was equal to 0, and the DescriptorHandle argument referred to an implicitly allocated APD. (This error does not occur with an explicitly allocated application descriptor, because it is not known whether an explicitly allocated application descriptor is an APD or ARD until execute time.) - SQLSetDescRec
The RecNumber argument was set to 0, and the DescriptorHandle referred to an IPD handle. The RecNumber argument was less than 0. The RecNumber argument was greater than the maximum number of columns or parameters that the data source can support, and the DescriptorHandle argument was an APD, IPD, or ARD. The RecNumber argument was equal to 0, and the DescriptorHandle argument referred to an implicitly allocated APD. (This error does not occur with an explicitly allocated application descriptor because it is not known whether an explicitly allocated application descriptor is an APD or ARD until execute time.) - SQLSetPos
The argument Operation was SQL_REFRESH or SQL_UPDATE, and a column was bound with a column number greater than the number of columns in the result set.
| | 07S01 | Invalid use of default parameter | | 
SQLSTATE 08| SQLSTATE | Error | Can be returned from |
|---|
| 08001 | Client unable to establish connection | | | 08002 | Connection name in use | - SQLBrowseConnect
(DM) The specified connection had already been used to establish a connection with a data source, and the connection was open. - SQLConnect
(DM) The specified ConnectionHandle had already been used to establish a connection with a data source, and the connection was still open or the user was browsing for a connection. - SQLDriverConnect
(DM) The specified ConnectionHandle had already been used to establish a connection with a data source, and the connection was still open. - SQLSetConnectAttr
The Attribute argument was SQL_ATTR_ODBC_CURSORS, and the driver was already connected to the data source.
| | 08003 | Connection does not exist | - SQLAllocHandle
(DM) The HandleType argument was SQL_HANDLE_STMT or SQL_HANDLE_DESC, but the connection specified by the InputHandle argument was not open. The connection process must be completed successfully (and the connection must be open) for the driver to allocate a statement or descriptor handle. - SQLDisconnect
(DM) The connection specified in the argument ConnectionHandle was not open. - SQLEndTran
(DM) The HandleType was SQL_HANDLE_DBC, and the Handle was not in a connected state. - SQLGetConnectAttr
(DM) An Attribute value that required an open connection was specified. - SQLGetInfo
(DM) The type of information requested in InfoType requires an open connection. Of the information types reserved by ODBC, only SQL_ODBC_VER can be returned without an open connection. - SQLNativeSql
The ConnectionHandle was not in a connected state. - SQLSetConnectAttr
(DM) An Attribute value was specified that required an open connection, but the ConnectionHandle was not in a connected state.
| | 08004 | Server rejected the connection | | | 08007 | Connection failure during transaction | - SQLEndTran
The HandleType was SQL_HANDLE_DBC, and the connection associated with the Handle failed during the execution of the function, and it cannot be determined whether the requested COMMIT or ROLLBACK occurred before the failure.
| | 08S01 | Communication link failure | | 
SQLSTATE 21| SQLSTATE | Error | Can be returned from |
|---|
| 21S01 | Insert value list does not match column list | - SQLDescribeParam
The number of parameters in the INSERT statement did not match the number of columns in the table named in the statement. - SQLExecDirect, SQLPrepare
*StatementText contained an INSERT statement, and the number of values to be inserted did not match the degree of the derived table.
| | 21S02 | Degree of derived table does not match column list | - SQLBulkOperations
The argument Operation was SQL_UPDATE_BY_BOOKMARK; and no columns were updateable because all columns were either unbound or read-only, or the value in the bound length/indicator buffer was SQL_COLUMN_IGNORE. - SQLExecDirect
*StatementText contained a CREATE VIEW statement, and the unqualified column list (the number of columns specified for the view in the column-identifier arguments of the SQL statement) contained more names than the number of columns in the derived table defined by the query-specification argument of the SQL statement. - SQLExecute
The prepared statement associated with the StatementHandle contained a CREATE VIEW statement, and the unqualified column list (the number of columns specified for the view in the column-identifier arguments of the SQL statement) contained more names than the number of columns in the derived table defined by the query-specification argument of the SQL statement. - SQLParamData
- SQLPrepare
*StatementText contained a CREATE VIEW statement, and the number of names specified is not the same degree as the derived table defined by the query specification. - SQLSetPos
The argument Operation was SQL_UPDATE, and no columns were updateable because all columns were either unbound, read-only, or the value in the bound length/indicator buffer was SQL_COLUMN_IGNORE.
| 
SQLSTATE 22| SQLSTATE | Error | Can be returned from |
|---|
| 22001 | String data, right-truncated | - SQLBulkOperations
The assignment of a character or binary value to a column in the result set resulted in the truncation of nonblank (for characters) or non-null (for binary) characters or bytes. - SQLExecDirect
The assignment of a character or binary value to a column resulted in the truncation of nonblank character data or non-null binary data. - SQLExecute
The assignment of a character or binary value to a column resulted in the truncation of nonblank (character) or non-null (binary) characters or bytes. - SQLFetch
A variable-length bookmark returned for a column was truncated. - SQLFetchScroll
A variable-length bookmark returned for a row was truncated. - SQLParamData
- SQLPutData
The assignment of a character or binary value to a column resulted in the truncation of nonblank (character) or non-null (binary) characters or bytes. The SQL_NEED_LONG_DATA_LEN information type in SQLGetInfo was "Y", and more data was sent for a long parameter (the data type was SQL_LONGVARCHAR, SQL_LONGVARBINARY, or a long data source�specific data type) than was specified with the StrLen_or_IndPtr argument in SQLBindParameter. The SQL_NEED_LONG_DATA_LEN information type in SQLGetInfo was "Y", and more data was sent for a long column (the data type was SQL_LONGVARCHAR, SQL_LONGVARBINARY, or a long data source-specific data type) than was specified in the length buffer corresponding to a column in a row of data that was added or updated with SQLBulkOperations or updated with SQLSetPos. - SQLSetDescField
The FieldIdentifier argument was SQL_DESC_NAME, and the BufferLength argument was a value larger than SQL_MAX_IDENTIFIER_LEN. - SQLSetPos
The Operation argument was SQL_UPDATE, and the assignment of a character or binary value to a column resulted in the truncation of nonblank (for characters) or non-null (for binary) characters or bytes.
| | 22002 | Indicator variable required but not supplied | | | 22003 | Numeric value out of range | - SQLBulkOperations
The Operation argument was SQL_ADD or SQL_UPDATE_BY_BOOKMARK, and the assignment of a numeric value to a column in the result set caused the whole (as opposed to fractional) part of the number to be truncated. The argument Operation was SQL_FETCH_BY_BOOKMARK, and returning the numeric value for one or more bound columns would have caused a loss of significant digits. - SQLExecDirect
*StatementText contained an SQL statement that contained a bound numeric parameter or literal, and the value caused the whole (as opposed to fractional) part of the number to be truncated when assigned to the associated table column. Returning a numeric value (as numeric or string) for one or more input/output or output parameters would have caused the whole (as opposed to fractional) part of the number to be truncated. - SQLExecute
The prepared statement associated with the StatementHandle contained a bound numeric parameter, and the parameter value caused the whole (as opposed to fractional) part of the number to be truncated when assigned to the associated table column. Returning a numeric value (as numeric or string) for one or more input/output or output parameters would have caused the whole (as opposed to fractional) part of the number to be truncated. - SQLExtendedFetch
Returning the numeric value (as numeric or string) for one or more columns would have caused the whole (as opposed to fractional) part of the number to be truncated. (Function returns SQL_SUCCESS_WITH_INFO.) For more information, see Guidelines for Interval and Numeric Data Types in Appendix D: Data Types. - SQLFetch
Returning the numeric value (as numeric or string) for one or more bound columns would have caused the whole (as opposed to fractional) part of the number to be truncated. For more information, see Converting Data from SQL to C Data Types in Appendix D: Data Types. - SQLFetchScroll
Returning the numeric value (as numeric or string) for one or more bound columns would have caused the whole (as opposed to fractional) part of the number to be truncated. For more information, see Guidelines for Interval and Numeric Data Types in Appendix D: Data Types. - SQLGetData
Returning the numeric value (as numeric or string) for the column would have caused the whole (as opposed to fractional) part of the number to be truncated. For more information, see Appendix D: Data Types. - SQLGetInfo
- SQLParamData
- SQLPutData
The data sent for a bound numeric parameter or column caused the whole (as opposed to fractional) part of the number to be truncated when assigned to the associated table column. Returning a numeric value (as numeric or string) for one or more input/output or output parameters would have caused the whole (as opposed to fractional) part of the number to be truncated. - SQLSetPos
The argument Operation was SQL_UPDATE, and the assignment of a numeric value to a column in the result set caused the whole (as opposed to fractional) part of the number to be truncated. The argument Operation was SQL_REFRESH, and returning the numeric value for one or more bound columns would have caused a loss of significant digits.
| | 22007 | Invalid datetime format | - SQLBulkOperations
The Operation argument was SQL_ADD or SQL_UPDATE_BY_BOOKMARK, and the assignment of a date or timestamp value to a column in the result set caused the year, month, or day field to be out of range. The argument Operation was SQL_FETCH_BY_BOOKMARK, and returning the date or timestamp value for one or more bound columns would have caused the year, month, or day field to be out of range. - SQLExecDirect
*StatementText contained an SQL statement that contained a date, time, or timestamp structure as a bound parameter, and the parameter was, respectively, an invalid date, time, or timestamp. An input/output or output parameter was bound to a date, time, or timestamp C structure, and a value in the returned parameter was, respectively, an invalid date, time, or timestamp. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExecute
The prepared statement associated with the StatementHandle contained an SQL statement that contained a date, time, or timestamp structure as a bound parameter, and the parameter was, respectively, an invalid date, time, or timestamp. An input/output or output parameter was bound to a date, time, or timestamp C structure, and a value in the returned parameter was, respectively, an invalid date, time, or timestamp. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLExtendedFetch
A character column in the result set was bound to a date, time, or timestamp C structure, and a value in the column was, respectively, an invalid date, time, or timestamp. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLFetch, SQLFetchScroll
A character column in the result set was bound to a date, time, or timestamp C structure, and a value in the column was, respectively, an invalid date, time, or timestamp. A character column in the result set was bound to a date, time, or timestamp C structure, and a value in the column was, respectively, an invalid date, time, or timestamp. - SQLGetData
The character column in the result set was bound to a C date, time, or timestamp structure, and the value in the column was an invalid date, time, or timestamp, respectively. For more information, see Appendix D: Data Types . - SQLNativeSql
*InStatementText contained an escape clause with an invalid date, time, or timestamp value. - SQLParamData
- SQLPutData
The data sent for a parameter or column that was bound to a date, time, or timestamp structure was, respectively, an invalid date, time, or timestamp. An input/output or output parameter was bound to a date, time, or timestamp C structure, and a value in the returned parameter was, respectively, an invalid date, time, or timestamp. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLSetPos
The argument Operation was SQL_UPDATE, and the assignment of a date or timestamp value to a column in the result set caused the year, month, or day field to be out of range. The argument Operation was SQL_REFRESH, and returning the date or timestamp value for one or more bound columns would have caused the year, month, or day field to be out of range.
| | 22008 | Datetime field overflow | - SQLBulkOperations
The Operation argument was SQL_ADD or SQL_UPDATE_BY_BOOKMARK, and the performance of datetime arithmetic on data being sent to a column in the result set resulted in a datetime field (the year, month, day, hour, minute, or second field) of the result falling outside the permissible range of values for the field or being invalid based on the Gregorian calendar's natural rules for datetimes. The Operation argument was SQL_FETCH_BY_BOOKMARK, and the performance of datetime arithmetic on data being retrieved from the result set resulted in a datetime field (the year, month, day, hour, minute, or second field) of the result falling outside the permissible range of values for the field or being invalid based on the Gregorian calendar's natural rules for datetimes. - SQLExecDirect
*StatementText contained an SQL statement that contained a datetime expression that, when computed, resulted in a date, time, or timestamp structure that was invalid. A datetime expression computed for an input/output or output parameter resulted in a date, time, or timestamp C structure that was invalid. - SQLExecute
The prepared statement associated with the StatementHandle contained an SQL statement that contained a datetime expression that, when computed, resulted in a date, time, or timestamp structure that was invalid. A datetime expression computed for an input/output or output parameter resulted in a date, time, or timestamp C structure that was invalid. - SQLParamData
- SQLPutData
A datetime expression computed for an input/output or output parameter resulted in a date, time, or timestamp C structure that was invalid. - SQLSetPos
The Operation argument was SQL_UPDATE, and the performance of datetime arithmetic on data being sent to a column in the result set resulted in a datetime field (the year, month, day, hour, minute, or second field) of the result being outside the permissible range of values for the field, or being invalid based on the Gregorian calendar's natural rules for datetimes. The Operation argument was SQL_REFRESH, and the performance of datetime arithmetic on data being retrieved from the result set resulted in a datetime field (the year, month, day, hour, minute, or second field) of the result being outside the permissible range of values for the field, or being invalid based on the Gregorian calendar's natural rules for datetimes.
| | 22012 | Division by zero | - SQLExecDirect
*StatementText contained an SQL statement that contained an arithmetic expression that caused division by zero. An arithmetic expression calculated for an input/output or output parameter resulted in division by zero. - SQLExecute
The prepared statement associated with the StatementHandle contained an arithmetic expression that caused division by zero. An arithmetic expression calculated for an input/output or output parameter resulted in division by zero. - SQLExtendedFetch
A value from an arithmetic expression was returned, which resulted in division by zero. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLFetch, SQLFetchScroll
A value from an arithmetic expression was returned, which resulted in division by zero. - SQLGetData
A value from an arithmetic expression that resulted in division by zero was returned. - SQLParamData
- SQLPutData
An arithmetic expression calculated for an input/output or output parameter resulted in division by zero.
| | 22015 | Interval field overflow | - SQLBulkOperations
The Operation argument was SQL_ADD or SQL_UPDATE_BY_BOOKMARK, and the assignment of an exact numeric or interval C type to an interval SQL data type caused a loss of significant digits. The Operation argument was SQL_ADD or SQL_UPDATE_BY_BOOKMARK; when assigning to an interval SQL type, there was no representation of the value of the C type in the interval SQL type. The Operation argument was SQL_FETCH_BY_BOOKMARK, and assigning from an exact numeric or interval SQL type to an interval C type caused a loss of significant digits in the leading field. The Operation argument was SQL_FETCH_BY_BOOKMARK; when assigning to an interval C type, there was no representation of the value of the SQL type in the interval C type. - SQLExecDirect, SQLExecute
*StatementText contained an exact numeric or interval parameter that, when converted to an interval SQL data type, caused a loss of significant digits. *StatementText contained an interval parameter with more than one field that, when converted to a numeric data type in a column, had no representation in the numeric data type. *StatementText contained parameter data that was assigned to an interval SQL type, and there was no representation of the value of the C type in the interval SQL type. Assigning an input/output or output parameter that was an exact numeric or interval SQL type to an interval C type caused a loss of significant digits. When an input/output or output parameter was assigned to an interval C structure, there was no representation of the data in the interval data structure. - SQLExtendedFetch
Assigning from an exact numeric or interval SQL type to an interval C type caused a loss of significant digits in the leading field. When fetching data to an interval C type, there was no representation of the value of the SQL type in the interval C type. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLFetch, SQLFetchScroll, SQLGetData
Assigning from an exact numeric or interval SQL type to an interval C type caused a loss of significant digits in the leading field. When fetching data to an interval C type, there was no representation of the value of the SQL type in the interval C type. - SQLParamData
- SQLPutData
The data sent for an exact numeric or interval column or parameter to an interval SQL data type caused a loss of significant digits. Data was sent for an interval column or parameter with more than one field, was converted to a numeric data type, and had no representation in the numeric data type. The data sent for column or parameter data was assigned to an interval SQL type, and there was no representation of the value of the C type in the interval SQL type. The data sent for an exact numeric or interval C column or parameter to an interval C type caused a loss of significant digits. The data sent for column or parameter data was assigned to an interval C structure, and there was no representation of the data in the interval data structure. - SQLSetPos
The Operation argument was SQL_UPDATE, and the assignment of an exact numeric or interval C type to an interval SQL data type caused a loss of significant digits. The Operation argument was SQL_UPDATE; when assigning to an interval SQL type, there was no representation of the value of the C type in the interval SQL type. The Operation argument was SQL_REFRESH, and assigning from an exact numeric or interval SQL type to an interval C type caused a loss of significant digits in the leading field. The Operation argument was SQL_REFRESH; when assigning to an interval C type, there was no representation of the value of the SQL type in the interval C type.
| | 22018 | Invalid character value for cast specification | - SQLBulkOperations
The Operation argument was SQL_FETCH_BY_BOOKMARK; the C type was an exact or approximate numeric, a datetime, or an interval data type; the SQL type of the column was a character data type; and the value in the column was not a valid literal of the bound C type. The argument Operation was SQL_ADD or SQL_UPDATE_BY_BOOKMARK; the SQL type was an exact or approximate numeric, a datetime, or an interval data type; the C type was SQL_C_CHAR; and the value in the column was not a valid literal of the bound SQL type. - SQLExecDirect, SQLExecute
*StatementText contained a C type that was an exact or approximate numeric, a datetime, or an interval data type; the SQL type of the column was a character data type; and the value in the column was not a valid literal of the bound C type. When an input/output or output parameter was returned, the SQL type was an exact or approximate numeric, a datetime, or an interval data type; the C type was SQL_C_CHAR; and the value in the column was not a valid literal of the bound SQL type. - SQLExtendedFetch
The C type was an exact or approximate numeric, a datetime, or an interval data type; the SQL type of the column was a character data type; and the value in the column was not a valid literal of the bound C type. (Function returns SQL_SUCCESS_WITH_INFO.) - SQLFetch, SQLFetchScroll, SQLGetData
A character column in the result set was bound to a character C buffer, and the column contained a character for which there was no representation in the character set of the buffer. The C type was an exact or approximate numeric, a datetime, or an interval data type; the SQL type of the column was a character data type; and the value in the column was not a valid literal of the bound C type. - SQLParamData
- SQLPrepare
*StatementText contained an SQL statement that contained a literal or parameter, and the value was incompatible with the data type of the associated table column. - SQLPutData
The C type was an exact or approximate numeric, a datetime, or an interval data type; the SQL type of the column was a character data type; and the value in the column or parameter was not a valid literal of the bound C type. The SQL type was an exact or approximate numeric, a datetime, or an interval data type; the C type was SQL_C_CHAR; and the value in the column or parameter was not a valid literal of the bound SQL type. - SQLSetPos
The Operation argument was SQL_REFRESH; the C type was an exact or approximate numeric, a datetime, or an interval data type; the SQL type of the column was a character data type; and the value in the column was not a valid literal of the bound C type. The argument Operation was SQL_UPDATE; the SQL type was an exact or approximate numeric, a datetime, or an interval data type; the C type was SQL_C_CHAR; and the value in the column was not a valid literal
| | 22019 | Invalid escape character | - SQLExecDirect
*StatementText contained an SQL statement that contained a LIKE predicate with an ESCAPE in the WHERE clause, and the length of the escape character following ESCAPE was not equal to 1. - SQLExecute
The prepared statement associated with StatementHandle contained a LIKE predicate with an ESCAPE in the WHERE clause, and the length of the escape character following ESCAPE was not equal to 1. - SQLPrepare
The argument StatementText contained a LIKE predicate with an ESCAPE in the WHERE clause, and the length of the escape character following ESCAPE was not equal to 1.
| | 22025 | Invalid escape sequence | - SQLExecDirect
*StatementText contained an SQL statement that contained "LIKE pattern value ESCAPE escape character" in the WHERE clause, and the character following the escape character in the pattern value was not one of "%" or "_". - SQLExecute
The prepared statement associated with StatementHandle contained "LIKE pattern value ESCAPE escape character" in the WHERE clause, and the character following the escape character in the pattern value was not one of "%" or "_". - SQLPrepare
The argument StatementText contained "LIKE pattern value ESCAPE escape character" in the WHERE clause, and the character following the escape character in the pattern value was neither "%" nor "_".
| | 22026 | String data, length mismatch | - SQLParamData
The SQL_NEED_LONG_DATA_LEN information type in SQLGetInfo was "Y", and less data was sent for a long parameter (the data type was SQL_LONGVARCHAR, SQL_LONGVARBINARY, or a long data source-specific data type) than was specified with the StrLen_or_IndPtr argument in SQLBindParameter. The SQL_NEED_LONG_DATA_LEN information type in SQLGetInfo was "Y", and less data was sent for a long column (the data type was SQL_LONGVARCHAR, SQL_LONGVARBINARY, or a long data source�specific data type) than was specified in the length buffer corresponding to a column in a row of data that was added or updated with SQLBulkOperations or updated with SQLSetPos.
| 
SQLSTATE 23| SQLSTATE | Error | Can be returned from |
|---|
| 23000 | Integrity constraint violation | - SQLBulkOperations
The Operation argument was SQL_ADD, SQL_DELETE_BY_BOOKMARK, or SQL_UPDATE_BY_BOOKMARK, and an integrity constraint was violated. The Operation argument was SQL_ADD, and a column that was not bound is defined as NOT NULL and has no default. The Operation argument was SQL_ADD, the length specified in the bound StrLen_or_IndPtr buffer was SQL_COLUMN_IGNORE, and the column did not have a default value. - SQLExecDirect
*StatementText contained an SQL statement that contained a parameter or literal. The parameter value was NULL for a column defined as NOT NULL in the associated table column, a duplicate value was supplied for a column constrained to contain only unique values, or some other integrity constraint was violated. - SQLExecute
The prepared statement associated with the StatementHandle contained a parameter. The parameter value was NULL for a column defined as NOT NULL in the associated table column, a duplicate value was supplied for a column constrained to contain only unique values, or some other integrity constraint was violated. - SQLParamData
- SQLSetPos
The argument Operation was SQL_DELETE or SQL_UPDATE, and an integrity constraint was violated.
| 
SQLSTATE 24| SQLSTATE | Error | Can be returned from |
|---|
| 24000 | Invalid cursor state | - SQLBulkOperations
The StatementHandle was in an executed state, but no result set was associated with the StatementHandle. - SQLCloseCursor
No cursor was open on the StatementHandle. (This is returned only by an ODBC 3.x driver.) - SQLColumnPrivileges, SQLColumns, SQLForeignKeys
A cursor was open on the StatementHandle, and SQLFetch or SQLFetchScroll had been called. This error is returned by the Driver Manager if SQLFetch or SQLFetchScroll has not returned SQL_NO_DATA, and is returned by the driver if SQLFetch or SQLFetchScroll has returned SQL_NO_DATA. A cursor was open on the StatementHandle, but SQLFetch or SQLFetchScroll had not been called. - SQLExecDirect
A cursor was positioned on the StatementHandle by SQLFetch or SQLFetchScroll This error is returned by the Driver Manager if SQLFetch or SQLFetchScroll has not returned SQL_NO_DATA, and is returned by the driver if SQLFetch or SQLFetchScroll has returned SQL_NO_DATA. A cursor was open but not positioned on the StatementHandle. *StatementText contained a positioned update or delete statement, and the cursor was positioned before the start of the result set or after the end of the result set. - SQLExecute
A cursor was positioned on the StatementHandle by SQLFetch or SQLFetchScroll. This error is returned by the Driver Manager if SQLFetch or SQLFetchScroll has not returned SQL_NO_DATA, and is returned by the driver if SQLFetch or SQLFetchScroll has returned SQL_NO_DATA. A cursor was open on the StatementHandle. The prepared statement associated with the StatementHandle contained a positioned update or delete statement and the cursor was positioned before the start of the result set or after the end of the result set. - SQLExtendedFetch, SQLFetch, SQLFetchScroll
The StatementHandle was in an executed state, but no result set was associated with the StatementHandle. - SQLGetData
(DM) The function was called without first calling SQLFetch or SQLFetchScroll to position the cursor on the row of data required. (DM) The StatementHandle was in an executed state, but no result set was associated with the StatementHandle. A cursor was open on the StatementHandle and SQLFetch or SQLFetchScroll had been called, but the cursor was positioned before the start of t
|
| |