trigger的有关问题

trigger的问题数据库中每个表都有个ModifyTime字段,我想写个TRIGGER,每当insert or updata时可以把对应记

trigger的问题
数据库中每个表都有个ModifyTime字段,我想写个TRIGGER,每当insert or updata时可以把对应记录的这个字段更新为系统当前时间。

[解决办法]

SQL code
/--创建一个单表的insert和update触发器: Create or replace trigger biu_tabletest  Before insert or update On tabletest  for each rowbegin  if updating then    update tabletest set ModifyTime = sysdate;    elseif inserting then     insert into tabletest values(:field1, ...sysdate);  end if;end biu_tabletest;