trigger with condition in sql

I want to implement a trigger when certain row is updated. There is an attribute called pno in the offer table.

create table logFile(pno int primary key, user_name varchar(100), date_chan date, old_Price int, new_Price int);
create or replace trigger update_price_property 
   AFTER UPDATE OF price ON offer 
   IF pno = 80 // this won't work, how can I add this condition?
     insert into logFile values (:old.pno, user, sysdate, :old.price, :new.price);

Read more here:

Content Attribution

This content was originally published by Ashley at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: