Cursor behaviors can affect how data is fetched when working with the iSeries™ Access ODBC driver.
Cursor types can be set via SQLSetStmtAttr with the SQL_ATTR_CURSOR_TYPE option.
The following factors can affect the concurrency of the cursor:
The ODBC driver uses the value of SQL_ROWSET_SIZE when dealing with SQLExtendedFetch. The driver uses the value of SQL_ATTR_ROW_ARRAY_SIZE when dealing with SQLFetch and SQLFetchScroll.
When there are LOBs in a result set there is a chance that locators may be used by the driver. Locators are internal handles to LOB fields. Locators are used when the setting for the MAXFIELDLEN connection option has a smaller value than the size of a LOB column in the result set. Locators can improve performance in some cases as the driver only gets the data the application asks for. The downside of locators is that there is some extra communication needed with the server. When locators are not used the driver will download more LOB data even if it is not used. It is strongly encouraged that the COMPRESSION connection option be enabled if locators are not being used. See Connection String keywords descriptions for more details on the MAXFIELDLEN keyword
SQLGetData can only be used for accessing data from single row fetches. Calling SQLGetData with multiple-row fetches is not supported.
There are several options that your application can use to determine the row count before fetching data: