SQLGetData (level one only)

SQLGetData returns result data for a single unbound column in the current row.

The application must call SQLFetch or SQLExtendedFetch and (optionally) SQLSetPos to position the cursor on a row of data before it calls SQLGetData. It is possible to use SQLBindCol for some columns and use SQLGetData for others within the same row. This function can be used to retrieve character or binary data values in parts from a column with a character, binary, or data source-specific data type (for example, data from SQL_LONGVARBINARY or SQL_LONGVARCHAR columns).

The following table describes the SQLSTATE and error values for SQLGetData.
SQLSTATE Error value Error message
01000 -11001 General warning
01004 -11003 Data truncated
07006 -11013 Restricted data- type attribute violation
08S01 -11020 Communication-link failure
22002 -11024 Indicator value required but not supplied
22003 -11025 Numeric value out of range
22005 -11026 Error in assignment
22008 -11027 Datetime-field overflow
22012 -11028 Division by zero
24000 -11031 Invalid cursor state
S1000 -11060 General error
S1001 -11061 Memory-allocation failure
S1002 -11062 Invalid column number
S1003 -11063 Program type out of range
S1008 -11065 Operation canceled
S1009 -11066 Invalid argument value
S1010 -11067 Function-sequence error
S1090 -11071 Invalid string or buffer length
S1109 -11089 Invalid cursor position
S1C00 -11092 Driver not capable
S1T00 -11094 Time-out expired
08S01 -11301 A protocol error has been detected. Current connection is closed.