How to UPSERT (INSERT or UPDATE) rows with MERGE in Oracle Database

preview_player
Показать описание
Often when loading data you want to add new rows and change the existing ones. So you need "update if exists, insert if not exists" logic, aka UPSERT. This can lead to complex statements and conditional logic.

The MERGE statement enables you to do both actions in one SQL statement.

This session covered the details of how this works. Highlights include:

05:15 - Overview of MERGE syntax
10:10 - Merging bind variable values
12:30 - Demo of MERGE
21:40 - Getting the INSERT vs UPDATE split for merged rows
22:30 - Using triggers to record INSERT vs UPDATE
25:00 - INSERT vs UPDATE count Flashback versions query
27:10 - INSERT vs UPDATE count with SQL Monitoring
33:35 - ORA-30926 unable to get a stable set of rows error
41:10 - Deleting rows in the target missing from the source
43:20 - Demo of insert vs update count, ORA-30926 error and deleting missing
52:30 - Performance of MERGE
57:50 - Demo of update only MERGE performance compared to UPDATEs
1:03:40 - Recap

Рекомендации по теме
Комментарии
Автор

Hey there, kudos to your efforts in this channel.
I am a newbie sql learner with a simple enquiry.
I learned recently that there are different dialects for database management systems.
Like MS SQL Server using T-SQL, and Oracle using PL/SQL.
What are the major differences between these two dialects in particular?
Thanks for taking care of my enquiry.

hasanmougharbel
Автор

how to get update and insert rows count after merge
in oracle

swethareddy-uv