IBM Support

IT31747: MERGE STATEMENT REFERENCING MATERIALIZED QUERY TABLES (MQTS) MAYFAIL WITH SQL0407N

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Example statement:
    
    MERGE INTO  T1 AS TGT
    USING   T2 AS SRC  ON  SRC.C1 = TGT.C1
    WHEN  MATCHED THEN
    UPDATE SET  TGT.C2 = COALESCE(SRC.C2,'')
    WHEN NOT MATCHED THEN
    INSERT VALUES   (SRC.C1, COALESCE(SRC.C2,''));
    
    Statement characteristics:
    + Merge  target table columns are not nullable
    + Merge source has nullable columns
    + Merge operation contains Update followed by Insert operations.
    + MQTs are defined on the target table. This is not a necessary
    requirement, but the presence of MQTs leads to complex execution
    plans that might expose the problem.
    

Local fix

  • Possible workaround: Alter table and drop the MQT definition.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * all                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to 11.1.4.7                                          *
    ****************************************************************
    

Problem conclusion

  • Upgrade to 11.1.4.7
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT31747

  • 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-02-04

  • Closed date

    2022-04-17

  • Last modified date

    2022-04-17

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

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

    IT39520

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:
03 May 2022