December 2002
Intermediate to advanced
928 pages
85h 29m
English
MERGE
MERGE INTOtable_name[alias] USING {table_name|viewname|subquery} ON (condition) WHEN MATCHED THENmerge_update_clauseWHEN NOT MATCHED THENmerge_insert_clause
Selects rows from a table for update of or insert into another table. This statement is used to avoid multiple INSERT and UPDATE statements. New with Oracle9i Release 2.
Specifies the name of the target table, that is, the table that will be updated or have rows inserted.
Specifies the name of the table, view, or subquery from which rows are to be selected.
Specifies a condition that will evaluate to either TRUE or FALSE. This is a SQL clause, and is typically a test for equality.
Specifies a SQL DML statement to be performed if condition is TRUE. This is normally an UPDATE statement.
Specifies a SQL DML statement to be performed if condition is not TRUE. This is normally an INSERT statement.
Common keywords and clauses: alias, table_name.