IBM Support

IT20898: QUERY AGAINST COLUMN ORGANIZED TABLE USING THE SAME DIVISION OPERATION IN NESTED CASE STATEMENTS CAN RECEIVE SQL0801N

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Using a query with nested CASE statements against Columnar
    Organized Tables including a division operation
    using column data can lead the query to end with :
     SQL0801N Division by zero was attempted
    
    example:
    CREATE TABLE test  ( test_col DECIMAL(29,16) ) ORGANIZE BY
    COLUMN;
    insert into test values (0),(NULL);
    SELECT
            CASE  WHEN result_1  IS NULL THEN -99999 ELSE
            CASE  WHEN result_1 = 0 THEN -99998 ELSE
            CASE  WHEN result_1 < 0 THEN -99996 ELSE (0 / result_1)
    END END END
    FROM (  SELECT
            CASE  WHEN test_col IS NULL  THEN NULL
                  ELSE
                    (0/(CASE WHEN test_col IS NULL THEN 0 ELSE 1
    END))
                  END AS result_1
                    FROM test
    )       ;
    

Local fix

  • rewrite the query to avoid nested case statements with division
    over the same value
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * COLUMN ORGANIZED TABLES                                      *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * See Error Description and install this fix.                  *
    ****************************************************************
    

Problem conclusion

  • See Error Description and install this fix.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT20898

  • 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

    2017-06-06

  • Closed date

    2018-03-19

  • Last modified date

    2018-03-19

  • 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 PSY

       UP

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

Document Information

Modified date:
19 March 2018