0

I am new to Oracle

I have 2 tables called

  • dwh_tbl_dim_supplier_type2_ar (target table)
  • stg_tbl_dim_supplier_ar (source table)

dwh_tbl_dim_supplier_type2_ar contains 6 column

  1. SUPPLIER_KEY (PK)
  2. SUPPLIER_CODE
  3. SUPPLIER_NAME
  4. SUPPLIER_STATE
  5. START_DATE
  6. END_DATE

stg_tbl_dim_supplier_ar contains 3 column

  1. SUPPLIER_KEY (PK)
  2. SUPPLIER_NAME
  3. SUPPLIER_STATE

In source table i already have a data SUPPLIER_KEY = 001 SUPPLIER_NAME = Phlogistical Supply Company SUPPLIER_STATE = IL

In target table i already have a data SUPPLIER_KEY = 001 SUPPLIER_CODE = 001 SUPPLIER_NAME = Phlogistical Supply Company SUPPLIER STATE = CA START_DATE = 2000-01-01 END_DATE = 9999-12-31

From these tables, there are differences in the SUPPLIER_STATE column. I have a task to update TARGET TABLE with data from SOURCE TABLE using SCD Type 2. This method tracks historical data by creating multiple records. Also the result in start_date and end_date column on target table must use date format without time (ex: 2020-06-18) How do i perform this task using SQL MERGE or another query on Oracle? Can anyone explain me step by step with Query? You can see the image below to see what it looks like.

Any help would be greatly appreciated.

Thanks

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.