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!

Can I use "else if" in a trigger ?

626351Apr 9 2009 — edited Apr 10 2009
My trigger works when I take out the "else if" part. Is there a way I can use something like the "else if" without getting compilation errors ? Either "nsn" or "load_date" is updated in the table ~ never both columns updated at the same time...

create or replace trigger upd_cib01_resolv_join_trg
after update on gateway.rpf_cib_resolved_join
for each row
when (old.scale_code = 'I4')
begin
if (:old.nsn != :new.nsn) then
update rpf_cib01_resolved_join
set nsn = :new.nsn
where cd_name = :old.cd_name and
zone_cell = :old.zone_cell and
frame_name = :old.frame_name;
else if (:old.load_date != :new.load_date) then
update rpf_cib01_resolved_join
set load_date = :new.load_date
where cd_name = :old.cd_name and
zone_cell = :old.zone_cell and
frame_name = :old.frame_name;
end if;
end;

thanks,
Vicki
This post has been answered by thomaso on Apr 9 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2009
Added on Apr 9 2009
3 comments
463 views