Friday, August 2, 2019

What is MERG ? Give me syntax?

Merge Statement combines the sequence of the conditional INSERT and UPDATE Commands in a single atomic statement , Depending on the existence of a record. This operation is commonly known as Upsert Functionality.

Syntax:

MERGE INTO <RECEIVING_DATA_TABLE>
USING <BASE_DATA_TABLE>
WHEN MATCHED THEN
UPDATE SET <COL1>=<VALUE>,<COL2>=<VALUE>
WHEN NT MATCHED THEN
INSERT(COL1,COL2....)
VALUES(VAL1,VAL2....);

we can use merge command to perform insert , update in a single command.



No comments:

Post a Comment

AME (Approval Management Engine)

AME (Approval Management Engine) : AME Stands for Oracle Approval Management Engine. AME is a self service web application that enables...