IBM Support

IC90916: QUERY CONTAINING EXISTS SUBQUERY AND FETCH FIRST N ROWS CLAUSE MIGHT PRODUCE INCORRECT RESULTS

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Under certain scenario, DB2 might produce incorrect results if
    the following conditions are true:
    1. The query contains an exists subquery
    2. The subquery has a fetch first n rows clause in the outer
    most subselect
    3. There is either a LOB column or a total column column width >
    32K in the query output list.
    
    Eg.:
    select P.lob
    from P
    where exists (select 1 from SQ where SQ.c1 = P.c1 fetch first 1
    rows only);
    

Local fix

  • 1. Remove fetch first n rows clause
    2. Add order by clause to the subquery.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 version 970 fix pack 9                        *
    ****************************************************************
    

Problem conclusion

  • Please upgrade to DB2 version 970 fix pack 9
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC90916

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-03-18

  • Closed date

    2014-01-13

  • Last modified date

    2014-01-13

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

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

    IC91798 IC91812 IC95426

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC90916

Modified date: 13 January 2014