Created
July 11, 2013 22:07
-
-
Save jpgreenwald/5979686 to your computer and use it in GitHub Desktop.
Oracle Upsert using merge
This file contains hidden or 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
MERGE INTO target_name T USING | |
( select 1 from dual) S ON | |
( clause_that_finds_record inside T ) | |
WHEN MATCHED THEN UPDATE | |
SET update_what_you_want_in_T | |
WHEN NOT MATCHED THEN | |
INSERT( | |
stuff_in_t | |
) VALUES( ...values... ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment