MERGE Statement in Oracle | DML | UPSERT | INSERT & UPDATE

Опубликовано: 18 Август 2023
на канале: Techie
109
3

An Oracle MERGE statement is used to pull data from the source table(s) and update or insert into the target table based on condition. Merge statement allows us to make condition-based insert or update into a target table. It is introduced in Oracle 9i version and it supports 9i or later version. It is a DML statement. It performs data manipulation operation on the table(s). This is a very useful function for pulling data from the source table and updating or inserting or deleting into a target table in a single statement using condition. Merge operation is also known as the UPSERT operation. In the same Merge statement, the same row cannot be updated multiple times. Users must have Insert / Update / Delete object privilege to perform Merge operation. This is a very convenient statement to combine multiple operations. Multiple DML statements can be avoided by using of Merge statement.