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!

Trigger on multiple columns with or condition.

127021Nov 27 2012 — edited Nov 27 2012
Hi,

I'm trying to create a after update trigger on a table for two columns with "or" condition. Its not allowing me to create like that. Is there any can I do?
drop table t1;
create table t1( a number,b number);

drop table t2; 
create table t2( c number);
 
create or replace
trigger trg_t1
after update  of (a or b)
on t2
for each row  when (new.a  is not null or new.b is not null)
declare
begin
  if :old.a:new.a
 then
      update t2 set c=a;
  end if ;
 
 
  if :old.b:new.b
 then
      update t2 set c=b;
  end if ;
end;
In advance thanks a lot.

Regards,
vg.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2012
Added on Nov 27 2012
6 comments
3,215 views