+ Reply to Thread
Results 1 to 2 of 2

Can't get simple MERGE to work

  1. Question Can't get simple MERGE to work

    Hi there,

    I have been using the ON DUPLICATE KEY UPDATE with MySql and I came across something similar using DB2 lately: MERGE.

    I have tried to adapt examples I found on Google, but I wasn't successful. Actually I have a pretty simple setup I believe:

    1 updateable View with a few columns like
    KEY1
    KEY2
    SUM1
    SUM2

    KEY1 & KEY2 together form a unique index.

    I want to insert a new row if no row with the supplied values of KEY1 & KEY2 ist present, I want to update SUM1 and SUM2 if the row is already present.
    I tried many things but apparently I just can't get the syntax right.

    Can anybody help?

    Thanks.

  2. Re: Can't get simple MERGE to work

    Does your view meet the conditions needed to be an updateable view as described in the DB2 documentation?

+ Reply to Thread