|
SQLSTATE
|
Error
|
Description
|
| 01000 | General warning | Driver-specific informational message. (Function returns SQL_SUCCESS_WITH_INFO.) |
| 01004 | String data, right truncated | 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." |
| 01S07 | Fractional truncation | 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.) |
| 07006 | Restricted data type attribute violation | The data value of a column in the result set cannot be converted to the C data type specified by the argument TargetType. |
| 07009 | Invalid descriptor index | 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. |
| 08S01 | Communication link failure | The communication link between the driver and the data source to which the driver was connected failed before the function completed processing. |
| 22002 | Indicator variable required but not supplied | StrLen_or_IndPtr was a null pointer and NULL data was retrieved. |
| 22003 | Numeric value out of range | 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. |
| 22007 | Invalid datetime format | 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. |
| 22012 | Division by zero | A value from an arithmetic expression that resulted in division by zero was returned. |
| 22015 | Interval field overflow | 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 returning data 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 | A character column in the result set was returned 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. |
| 24000 | Invalid cursor state | (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 the result set or after the end of the result set. |
| HY000 | General error | An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by SQLGetDiagRec in the MessageText buffer describes the error and its cause. |
| HY001 | Memory allocation error | The driver was unable to allocate memory required to support execution or completion of the function. |
| HY003 | Program type out of range | (DM) The argument TargetType was neither a valid data type, SQL_C_DEFAULT, nor SQL_ARD_TYPE. (DM) The argument ColumnNumber was 0, and the argument TargetType was not SQL_C_BOOKMARK for a fixed-length bookmark or SQL_C_VARBOOKMARK for a variable-length bookmark. |
| HY008 | Operation canceled | Asynchronous processing was enabled for the StatementHandle. The function was called, and before it completed execution, SQLCancel was called on the StatementHandle, and then the function was called again on the StatementHandle. The function was called, and before it completed execution, SQLCancel was called on the StatementHandle from a different thread in a multithread application, and then the function was called again on the StatementHandle. |
| HY009 | Invalid use of null pointer | (DM) The argument TargetValuePtr was a null pointer. To resolve this error, put "0" in the BufferLength and a non-NULL pointer in TargetValuePtr. SQLGetData will return the size of the column in StrLen_or_IndPtr. Then, allocate the buffer as needed. SQLGetData(hstmt, 1, SQL_C_WCHAR, NULL, 0, &cbValue);
// Allocate space for the data.
LPWSTR pwszValue = (LPWSTR)malloc(cbValue);
SQLGetData(hstmt, 1, SQL_C_WCHAR, pwszValue, cbValue, NULL); When retrieving data in parts, obtain the remaining size of the data through StrLen_or_IndPtr. |
| HY010 | Function sequence error | (DM) The specified StatementHandle was not in an executed state. The function was called without first calling SQLExecDirect, SQLExecute or a catalog function. (DM) An asynchronously executing function (not this one) was called for the StatementHandle and was still executing when this function was called. (DM) SQLExecute, SQLExecDirect, SQLBulkOperations, or SQLSetPos was called for the StatementHandle and returned SQL_NEED_DATA. This function was called before data was sent for all data-at-execution parameters or columns. (DM) The StatementHandle was in an executed state, but no result set was associated with the StatementHandle. |
| HY013 | Memory management error | The function call could not be processed because the underlying memory objects could not be accessed, possibly because of low memory conditions. |
| HY090 | Invalid string or buffer length | (DM) The value specified for argument BufferLength was less than 0. The value specified for argument BufferLength was less than 4, the ColumnNumber argument was set to 0, and the driver was an ODBC 2.x driver. |
| HY109 | Invalid cursor position | The cursor was positioned (by SQLSetPos, SQLFetch, SQLFetchScroll, or SQLBulkOperations) on a row that had been deleted or could not be fetched. The cursor was a forward-only cursor, and the rowset size was greater than one. |
| HYC00 | Optional feature not implemented | The driver or data source does not support use of SQLGetData with multiple rows in SQLFetchScroll. This description does not apply to drivers that return the SQL_GD_BLOCK bitmask for the SQL_GETDATA_EXTENSIONS option in SQLGetInfo. The driver or data source does not support the conversion specified by the combination of the TargetType argument and the SQL data type of the corresponding column. This error applies only when the SQL data type of the column was mapped to a driver-specific SQL data type. The driver supports only ODBC 2.x, and the argument TargetType was one of the following: SQL_C_GUID SQL_C_NUMERIC SQL_C_SBIGINT SQL_C_UBIGINT and any of the interval C data types listed in C Data Types in Appendix D: Data Types. |
| HYT01 | Connection timeout expired | The connection timeout period expired before the data source responded to the request. The connection timeout period is set through SQLSetConnectAttr, SQL_ATTR_CONNECTION_TIMEOUT. |
| IM001 | Driver does not support this function | (DM) The driver corresponding to the StatementHandle does not support the function. |