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

Поделиться
HTML-код
  • Опубликовано: 21 июл 2022
  • 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
    Get the scripts for this session bit.ly/SQL-ATOH-MERGE
    Improve Your SQL Skills with this FREE course devgym.oracle.com/pls/apex/dg...
  • НаукаНаука

Комментарии • 2

  • @swethareddy-u8v
    @swethareddy-u8v 17 дней назад

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

  • @hasanmougharbel8030
    @hasanmougharbel8030 2 года назад

    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.