Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update trigger to update another table

eyapJan 9 2015 — edited Jan 12 2015

I'm trying to write a table trigger (AFTER UPDATE) wherein I want to update the same table in a different schema. Note that both tables does not have any unique or primary key constraint thus I am forced to compare all values in all the column in the where condition.

update OTHERSCHEMA.T1

set c1=:NEW.c1, c2=:NEW.c2...

where c1=:OLD.c1

AND c2=:OLD.c2

Problem is when one column is null it would seem it cannot be compared. I even tried

update OTHERSCHEMA.T1

set c1=:NEW.c1, c2=:NEW.c2...

where NVL(c1,NULL)=NVL(:OLD.c1,NULL)

AND NVL(c2,NULL=NVL(:OLD.c2,NULL)

to no avail. Can someone help me write the correct statement?

This post has been answered by Frank Kulash on Jan 10 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2015
Added on Jan 9 2015
4 comments
1,582 views