MERGE Statement
Translation reference to convert Oracle MERGE statement to Snowflake Scripting
Description
MERGE [ hint ]
INTO [ schema. ] { table | view } [ t_alias ]
USING { [ schema. ] { table | view }
| ( subquery )
} [ t_alias ]
ON ( condition )
[ merge_update_clause ]
[ merge_insert_clause ]
[ error_logging_clause ] ;
merge_update_clause := WHEN MATCHED THEN
UPDATE SET column = { expr | DEFAULT }
[, column = { expr | DEFAULT } ]...
[ where_clause ]
[ DELETE where_clause ]
merge_insert_clause := WHEN NOT MATCHED THEN
INSERT [ (column [, column ]...) ]
VALUES ({ expr | DEFAULT }
[, { expr | DEFAULT } ]...
)
[ where_clause ]
error_logging_clause := LOG ERRORS
[ INTO [schema.] table ]
[ (simple_expression) ]
[ REJECT LIMIT { integer | UNLIMITED } ]
where_clause := WHERE conditionSample Source Patterns
Sample auxiliary data
MERGE Statement simple case
Oracle
Snowflake
MERGE Statement with DELETE and where clause
Changed required:
Oracle
Snowflake
Oracle
Snowflake
Known Issues
1. Oracle's error_logging_clause is not supported
2. Changed applied do not work as expected
Related EWIs
Last updated
