Oracle SQL trigger on update of column

后端 未结 4 800
误落风尘
误落风尘 2021-01-04 02:36

I\'m trying to create a trigger for my table which automatically adds a published date based on when a certain flag is set to \'Y\'

I don\'t have much experience wit

4条回答
  •  走了就别回头了
    2021-01-04 03:08

    create or replace
      TRIGGER ADD_CREATE_DT 
      after UPDATE of approved ON articles 
      for each row
      BEGIN
        IF :NEW.approved = 'Y' THEN
          :new.create_dt := sysdate;
        END IF;
      END;
    

提交回复
热议问题