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?
   BEGIN
     insert into logFile values (:old.pno, user, sysdate, :old.price, :new.price);
   END;
/


Read more here: https://stackoverflow.com/questions/64938685/trigger-with-condition-in-sql

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: