IBM Support

IT21696: SELECT FROM VIEW WITH DECIMAL(DATE) FAILS WITH SQLCODE SQL0344N,SQLSTATE 42825

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Selecting from a view returns SQLCODE SQL0344N, SQLSTATE 42825.
    
    This can happen if the view definition includes
    SYSIBM.DECIMAL(DATE) in the select list.
    
    For example:
    CREATE VIEW TEST_VIEW AS SELECT DECIMAL(CURRENT DATE) D FROM
    SYSIBM.SYSDUMMY1
    DB20000I  The SQL command completed successfully.
    
    SELECT * FROM TEST_VIEW
    SQL0344N  The recursive common table expression "TEST_VIEW" has
    mismatched data types, lengths or code pages for column "D".
    SQLSTATE=42825
    
    The same applies to the synonym SYSIBM.DEC(DATE).
    

Local fix

  • Change the view definition to cast the expression to a different
    size DECIMAL and back to DECIMAL(8,0):
    
    CREATE VIEW TEST_VIEW AS SELECT CAST( CAST( DECIMAL(CURRENT
    DATE) AS DECIMAL(9,0) ) AS DECIMAL(8,0) ) D FROM
    SYSIBM.SYSDUMMY1
    DB20000I  The SQL command completed successfully.
    
    SELECT * FROM TEST_VIEW
    
    D
    ----------
     20150813.
    
      1 record(s) selected.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 11.1 Mod 4 Fixpack 4 or higher                *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 11.1 Mod 4 Fixpack 4
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT21696

  • 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-08-03

  • Closed date

    2018-11-27

  • Last modified date

    2018-11-27

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

    IT10719

  • 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":"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:
27 November 2018