User Profile

Collapse

Profile Sidebar

Collapse
martyy
martyy
Last Activity: Mar 4 '13, 02:48 PM
Joined: Mar 1 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I was able to do the merge using the following code.

    Code:
    MERGE INTO tbltarget AS A
     
    USING (
     
    SELECT B.CUSTNUM_NEW, B.CUSTNUM_OLD, B.MASTER FROM tblsource B 
    ) AS B ON (
     
    B.CUSTNUM_OLD = A.CUSTNUM AND B.MASTER='0'
     
    )
     
    WHEN MATCHED THEN
     
    UPDATE SET 
    A.CUSTNUM = B.CUSTNUM;
    See more | Go to post

    Leave a comment:


  • martyy
    started a topic Update or merge field from 2nd table - DB2 iSeries
    in DB2

    Update or merge field from 2nd table - DB2 iSeries

    I am working on an iSeries v7r1 to consolidate customer accounts after de-deuplication. I am struggling with a fairly simply update to a single field from a value in another table.

    tbl_target
    CUSTNUM

    tbl_source
    CUSTNUM_NEW
    CUSTNUM_OLD
    MASTER

    What I need to do is
    UPDATE tbl_target.CUST NUM=tbl_source. CUSTNUM_NEW WHERE tbl_target.CUST NUM = tbl_source_OLD ONLY getting the...
    See more | Go to post
No activity results to display
Show More
Working...