对于Oracle触发器中的new和old
:new --为一个引用最新的列值;
:old --为一个引用以前的列值;
这两个变量只有在使用了关键字 "FOR EACH ROW"时才存在.且update语句两个都有,而insert只有:new ,delect 只有:old;
CREATE OR REPLACE TRIGGER TRIG_TZTG_ROW AFTER INSERT OR UPDATE ON T_TZTG FOR EACH ROW newState integer; oldState integer; intId integer; strF_name varchar2(200); lrrq date; newQunId number; intQuntype integer; strQunSwjgdm varchar2(50); BEGIN newState := :new.state; oldState := :old.state; strSwjgs := :new.swjg_dm; strSwrys := :new.swry_dm; intId := :new.id; strF_name := :new.f_name; lrrq := :new.lrrq; newQunId := :new.qunid;