Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.57 KB

using-autofetch-with-odbc-cursors.md

File metadata and controls

25 lines (20 loc) · 1.57 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Using Autofetch with ODBC Cursors
Using Autofetch with ODBC Cursors
markingmyname
maghan
03/14/2017
sql
native-client
reference
ODBC cursors, autofetch
autofetch option
cursors [ODBC], autofetch

Using Autofetch with ODBC Cursors

[!INCLUDE SQL Server]

When connected to an instance of [!INCLUDEssNoVersion], the [!INCLUDEssNoVersion] Native Client ODBC driver supports an autofetch option when using any server cursor type. With autofetch, the SQLExecute or SQLExecDirect function that opens the cursor also has an implicit SQLFetchScroll(SQL_FIRST) function. The rows comprising the first rowset are returned to the bound application variables as part of the statement execution, saving another roundtrip across the network to the server. SQLGetData is not supported when the autofetch option is enabled; the result set columns must be bound to program variables.

Applications request autofetch by setting the driver-specific SQL_SOPT_SS_CURSOR_OPTIONS statement attribute to SQL_CO_AF.

See Also

Cursor Programming Details (ODBC)