添加触发器sql语句:
1、在a字段满足某种条件时变更b时间字段时间及c字符集字段内容
CREATE OR REPLACE TRIGGER PRD_FOR_LASTPRD_TRG
BEFORE INSERT ON PRD_ERROR_FEEDBACK FOR EACH ROW
BEGIN
if :new.RECIEVERINFO like '%111%' or :new.RECIEVERINFO like '%222%' then
select sysdate + 23/(24*60) into :new.READ_TIME from dual;
:new.PROCESSSTATE := '处理中';
end if;
END;
2、另注id自增触发器:
-- 建序列器
create sequence PRD_STATIC_CONFIGURATION_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
nocache;
-- 建id自增触发器
CREATE OR REPLACE TRIGGER PRD_STATIC_CONFIGURATION_TRG
BEFORE INSERT ON PRD_STATIC_CONFIGURATION FOR EACH ROW
WHEN(NEW.ID Is NULL)
BEGIN
SELECT PRD_STATIC_CONFIGURATION_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END;