This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Generate Merge statement from target table definition | |
-- Original version by RazorFink: https://gist.github.com/RazorFink/5936619 | |
-- I simply added a WHERE clause on UPDATE statement, so only records w/ changes are updated. | |
WITH target AS | |
(SELECT UPPER(TRIM(:owner)) AS owner, | |
UPPER(TRIM(:table_name)) AS table_name | |
FROM dual), | |
all_cols AS | |
(SELECT atc.owner AS owner, | |
atc.table_name AS table_name, |