Contents|Index|Previous|Next

SQLGetData in the Cursor Library

The cursor library implements SQLGetData by first constructing a SELECT statement with a WHERE clause that enumerates the values stored in its cache for each bound column in the current row. It then executes the SELECT statement to reselect the row and calls SQLGetData in the driver to retrieve the data from the data source (as opposed to the cache).

Caution The WHERE clause constructed by the cursor library to identify the current row can fail to identify any rows, identify a different row, or identify more than one row. For more information, see Constructing Searched Statements earlier in this appendix.

If the SQL_ATTR_USE_BOOKMARKS statement attribute is set to SQL_UB_VARIABLE, SQLGetData can be called on column 0 to return bookmark data.

Calls to SQLGetData are subject to the following restrictions:

odbc00090000.gif SQLGetData cannot be called for forward-only cursors.

odbc00090000.gif SQLGetData can only be called when a SELECT statement generated the result set, the SELECT statement did not contain a join, a UNION clause, or a GROUP BY clause, and any columns that used an alias or expression in the select list were not bound with SQLBindCol.

odbc00090000.gif If the driver supports only one active statement, the cursor library fetches the rest of the result set before executing the SELECT statement and calling SQLGetData.