DB2 - Problem description
Problem IC67227 | Status: Closed |
THE WRONG ROW MIGHT BE FETCHED WHEN USING ADO WITH ODBC OR USING CLI WITH SQL_ATTR_RETRIEVE_DATA=0 IN A SCROLLABLE CURSOR. | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
The wrong row might be fetched when using Microsoft ADO with the Microsoft OLEDB-ODBC bridge provider (MSDASQL) or running a CLI application and using the SQLSetStmtAttr() attribute, SQL_ATTR_RETRIEVE_DATA with a value of 0 when using a scrollable cursor. The problem stems from the DB2 cursor manager making a request to get a second row when it should have only made a request for one row. Here is some sample ADO code that represents this problem: intCount = 0 Do Until objRS.EOF intCount = intCount + 1 objRS.MoveNext Loop objRS.Close strMsg = strMsg & " The recordset contains " & intCount & " records." & vbCrLf The number of rows returned by the loop is one less than the number of actual rows in the entire cursor. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * The wrong row might be fetched when using Microsoft ADO with * * the Microsoft OLEDB-ODBC bridge provider (MSDASQL) or * * running a CLI application and using the SQLSetStmtAttr() * * attribute, SQL_ATTR_RETRIEVE_DATA with a value of 0 when * * using a scrollable cursor. * * . * * The problem stems from the DB2 cursor manager making a * * request to get a second row when it should have only made a * * request for one row. * * . * * Here is some sample ADO code that represents this problem: * * . * * intCount = 0 * * Do Until objRS.EOF * * intCount = intCount + 1 * * objRS.MoveNext * * Loop * * objRS.ClosestrMsg = strMsg & " The recordset contains " & * * intCount & "records." & vbCrLf * * . * * The number of rows returned by the loop is one less than the * * number of actual rows in the entire cursor. * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 9.7, Fixpak 3 * **************************************************************** | |
Local Fix: | |
If connecting to a DB2 for z/OS server, then using a keyset cursor will workaround the problem, otherwise a non-scrollable cursor will work against any DB2 server. If using ADO, then the IBM OLE DB provider (IBMDADB2) will workaround the problem as well. | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows | |
Solution | |
First fixed in DB2 UDB Version 9.7, Fixpak 3 | |
Workaround | |
see LOCAL FIX | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 15.03.2010 27.09.2010 27.09.2010 |
Problem solved at the following versions (IBM BugInfos) | |
9.7. | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.3 | |
9.7.0.3 |