Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 1.44 KB

retrieving-bookmarks.md

File metadata and controls

24 lines (20 loc) · 1.44 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Retrieving Bookmarks
Retrieving Bookmarks
David-Engel
davidengel
01/19/2017
sql
connectivity
conceptual
retrieving bookmarks [ODBC]
result sets [ODBC], bookmarks
bookmarks [ODBC]

Retrieving Bookmarks

If the application will use bookmarks, it must set the SQL_ATTR_USE_BOOKMARKS statement attribute to SQL_UB_VARIABLE before preparing or executing the statement. This is necessary because building and maintaining bookmarks can be an expensive operation, so bookmarks should be enabled only when an application can make good use of them.

Bookmarks are returned as column 0 of the result set. There are three ways an application can retrieve them:

  • Bind column 0 of the result set. SQLFetch or SQLFetchScroll returns the bookmarks for each row in the rowset along with the data for other bound columns.

  • Call SQLSetPos to position to a row in the rowset and then call SQLGetData for column 0. If a driver supports bookmarks, it must always support the ability to call SQLGetData for column 0, even if it does not allow applications to call SQLGetData for other columns before the last bound column.

  • Call SQLBulkOperations with the Operation argument set to SQL_ADD, and column 0 bound. The cursor inserts the row and returns the bookmark for the row in the bound buffer.