oracle中使用update触发器更新时间

create or replace trigger TIG_USER
before update on "USER" for each row

begin
       select sysdate into :new.update_date from dual;
exception when others then
       
end;

上面的代码是数据更新前给字段update_date添加为当前时间。

 

 

或者

create or replace trigger TIG_USER
before update on "USER" for each row

begin
       new.update_date:=sysdate;       
end;

 

posted @ 2019-09-07 14:59  masha2017  阅读(6176)  评论(0编辑  收藏  举报