IBM Support

JR35899: THE WRONG ROW MIGHT BE FETCHED WHEN USING ADO WITH ODBC OR USING CLI WITH SQL_ATTR_RETRIEVE_DATA=0 IN A SCROLLABLE CURSOR.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error 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.
    

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.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * The wrong row might be fetched when using Microsoft ADO      *
    * withthe Microsoft OLEDB-ODBC bridge provider (MSDASQL)       *
    * orrunning a CLI application and using the                    *
    * SQLSetStmtAttr()attribute, SQL_ATTR_RETRIEVE_DATA with a     *
    * value of 0 whenusing a scrollable cursor.The problem stems   *
    * from the DB2 cursor manager making arequest to get a second  *
    * row when it should have only made arequest for one row.Here  *
    * is some sample ADO code that represents this                 *
    * problem:intCount = 0Do Until objRS.EOFintCount = intCount +  *
    * 1objRS.MoveNextLoopobjRS.ClosestrMsg = strMsg & "  The       *
    * recordset contains " & intCount & "records." & vbCrLfThe     *
    * number of rows returned by the loop is one less than         *
    * thenumber of actual rows in the entire cursor.               *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 Version 9.5, Fixpak 6                         *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 UDB Version 9.5, Fixpak 6
    

Temporary fix

Comments

APAR Information

  • APAR number

    JR35899

  • Reported component name

    DB2 UDB ESE WIN

  • Reported component ID

    5765F4101

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-03-11

  • Closed date

    2010-05-25

  • Last modified date

    2010-05-25

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    IC67227 IC67533

Fix information

  • Fixed component name

    DB2 UDB ESE WIN

  • Fixed component ID

    5765F4101

Applicable component levels

  • R950 PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
25 May 2010