Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

MERGE WITH MULTIPLE UPDATES/INSERT -- help

sivaGanFeb 6 2014 — edited Feb 6 2014

MERGE INTO CUSTOMER DC USING ACCOUNT MDC ON(DC.CUSTOMER_KEY = MDC.ACC_KEY)

WHEN MATCHED THEN
UPDATE SET Col WHERE MDC.INS_UPD_SCD='UPD'
UPDATE SET WHERE MDC.INS_UPD_SCD='SCD'
INSERT WHERE MDC.INS_UPD_SCD='SCD'
WHEN NOT MATCHED THEN INSERT

HI All,

I wanted to know if it is possible to have multiple statements (UPDATE & INSERT) when using MERGE and WHEN MATCHED. I want a kind of implement loop inside merge, is it possible. Please give me a sample syntax, thanks for your help.

This post has been answered by Partha Sarathy S on Feb 6 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2014
Added on Feb 6 2014
15 comments
18,437 views