CREATE OR REPLACE TRIGGER TR_SELL_SELLLOG
AFTER UPDATE
ON mis_sell
REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
DECLARE
BEGIN
if :new.status<>:old.status
then
insert into mis_selllog (...)
values(:new.status,:new.updateTime);
end if;
AFTER UPDATE
ON mis_sell
REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
DECLARE
BEGIN
if :new.status<>:old.status
then
insert into mis_selllog (...)
values(:new.status,:new.updateTime);
end if;
END TR_SELL_SELLLOG;
说明:当MIS_SELL表的状态改变时,记录到日志表中。