Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.57 KB

File metadata and controls

25 lines (20 loc) · 1.57 KB
title Using Autofetch with ODBC Cursors
description Using Autofetch with ODBC Cursors
author markingmyname
ms.author maghan
ms.date 03/14/2017
ms.service sql
ms.subservice native-client
ms.topic reference
helpviewer_keywords
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)