Tuesday, March 16, 2010

ORA-38104: Columns referenced in the ON Clause cannot be updated

When you use Merge statement, you cannot update the columns reference in the ON Clause.

Not many know that, Merge supports "WHERE Clause".

Add a Where Clause to your Update statement under "When Matched"

Merge Into ...
Using ()
On() 
When Matched then
Update ...
Where ...
When Not Matched then
......

1 comment:

  1. ...which generates: SQL Error: ORA-00969: missing ON keyword

    ReplyDelete