I have table LOCNAG_ENT and jsut for test i cloned this table and changed some ENTERPRISE_ID for exact LOCACCESSGRP_ID and trying to merge. MERGE INTO LOCNAG_ENT as tgt How can i procceed with logic if i have same values from both tables (agrp_id, enterpsie_id) then just skip, if i have new values in source table but doesn't have in target, then insert, if i doesn't have values in source table which have target table, then delete them? |
DELETE is not permitted in a NOT MATCH. How then can i procceed with logic if i have same values from both tables (agrp_id, enterpsie_id) then just skip, if i have new values in source table but doesn't have in target, then insert, if i doesn't have values in source table which have target table, then delete them?
(22 Nov '21, 11:01)
Taifunov
1
A second MERGE that deals with the DELETE but formed as a WHEN MATCHED would be an option.
(22 Nov '21, 21:43)
Chris Keating
|