IBM Support

IT35150: UNEXPECTED SQL0538 WITH NTILE BUILTIN FUNCTION

Subscribe

You can track all active APARs for this component.

 

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

  • RB10 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
04 May 2022