Skip to content

Latest commit

 

History

History
20 lines (18 loc) · 1.24 KB

setting-up-the-cursor.md

File metadata and controls

20 lines (18 loc) · 1.24 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Setting Up the Cursor
Setting Up the Cursor
David-Engel
davidengel
01/19/2017
sql
connectivity
conceptual
scrollable cursors [ODBC]
cursors [ODBC], scrollable
cursors [ODBC], creating

Setting Up the Cursor

The application can specify the cursor type before executing a statement that creates a result set. It does this with the SQL_ATTR_CURSOR_TYPE statement attribute. If the application does not explicitly specify a type, a forward-only cursor will be used. To get a mixed cursor, an application specifies a keyset-driven cursor but declares a keyset size less than the result set size.

For keyset-driven and mixed cursors, the application can also specify the keyset size. It does this with the SQL_ATTR_KEYSET_SIZE statement attribute. If the keyset size is set to 0, which is the default, the keyset size is set to the result set size and a keyset-driven cursor is used. The keyset size can be changed after the cursor has been opened.

The application can also set the rowset size; for more information, see Using Block Cursors, earlier in this section.