Updating table using cursor in oracle
The only rows affected by the delete clause of the MERGE statement are those rows in the target table that are updated by the merge operation.This means the DELETE WHERE condition evaluates the updated value, not the original value of the row.Even if a row of the target table satisfies the DELETE condition but is not included in the data set from the join defined by the MERGE's ON clause, then it is not deleted.
The condition can refer only to the MERGE data source.
If the column list after the INSERT keyword is left out, the number of columns in the target table must match the number of values in the VALUES clause.
If you wish to insert all of the MERGE source rows into the table, you should use what is known as a "constant filter predicate" in the ON clause.
USING Clause - The USING clause specifies the source of the data to be updated or inserted.
The source for a MERGE statement can be a table, view, or the result of a subquery.