home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

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
DB2 Version 9.7 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 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 FixList
9.7.0.3 FixList