IBM Support

IT27914: MERGE STATEMENT RETURNS SQLCODE -206 WITH EMPTY OR WRONG COLUMN NAME

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A MERGE statement that references an uknown column may return an
    empty or wrong column name in SQL0206.  For example:
    
    CREATE TABLE SCHEMA1.TEST2 (
        ID INTEGER
       ,DESCRIPTION VARCHAR(20)
       ,UPDATE_TIMESTAMP TIMESTAMP
    );
    
    
    MERGE INTO SCHEMA1.TEST2 T
    USING ( VALUES (
        1
       ,'Test Value'
       ,CURRENT TIMESTAMP
       ,'USER1'
    )) AS VALUE_TABLE (ID, DESCRIPTION, UPDATE_TIMESTAMP,
    UPDATE_USERID)
    ON VALUE_TABLE.ID = T.ID
    WHEN MATCHED THEN
       UPDATE SET T.UPDATE_TIMESTAMP = VALUE_TABLE.UPDATE_TIMESTAMP
    --             ,T.UPDATE_USERID = VALUE_TABLE.UPDATE_USERID
    WHEN NOT MATCHED THEN
       INSERT (ID, DESCRIPTION, UPDATE_TIMESTAMP, UPDATE_USERID)
       VALUES (VALUE_TABLE.ID, VALUE_TABLE.DESCRIPTION,
    VALUE_TABLE.UPDATE_TIMESTAMP, VALUE_TABLE.UPDATE_USERID)
    ;
    
    SQL0206N "" is not valid in the context where it is used.
    SQLSTATE=42703
    

Local fix

  • None, study the MERGE statement closely to identify the
    problematic column reference.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 version 11.1.4.7                              *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 version 11.1.4.7
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT27914

  • 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

    2019-01-29

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

    IT27915 IT38214

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