IBM Support

IT35150: UNEXPECTED SQL0538 WITH NTILE BUILTIN FUNCTION

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • NTILE is non-deterministic in that the same value may fall into
    multiple TILES depending on data set and # tiles choosen.
    However for a given set of data and sort order the rows will
    fall into the same TILES and thus deterministic from a SQL
    compiler perspective.
    Example:
    db2 "select firstnme, lastname, salary, ntile(3) over (order by
    salary) salary_ntile from employee"
    
    above query works but when NTILE is used in a CASE expression it
    produces
    non-deterministic error SQL0583N
    db2 "select firstnme, lastname, salary, case ntile(3) over
    (order by salary) when 1 then 'a' when 2 then 'b' when 3 then
    'c' end  as salary_ntile  from employee"
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Db2V11.1.4.5 or lower                                        *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Update to  DB2V11.1.4.6 or higher                            *
    ****************************************************************
    

Problem conclusion

  • Problem Fixed in DB2V11.1.4.6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT35150

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-12-03

  • Closed date

    2021-02-18

  • Last modified date

    2021-02-18

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

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

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1"}]

Document Information

Modified date:
27 February 2021