Last week, I found my after insert or update trigger wasn't working. After I disabled and enabled it, it started working again.
I do not yet know why it stopped working. Is there any way to deal with this? Because this trigger is recording the value of daily jobs, and is used for report purposes. If this trigger goes dead in few days without my notice or error, I will be in hot water.
I am using Oracle 10g, access the db by using sqldeveloper
My Trigger
create or replace
TRIGGER MASTER.INSTANCE_STEP_TRG
AFTER INSERT OR UPDATE OF SYSID,STEP_ID,INSTANCE_ID,PARENT_STEP_ID ON MASTER.WF_INSTANCE_STEP
REFERENCING OLD AS old NEW AS new
FOR EACH ROW
WHEN (new.sysid > 0)
declare
stepSysid number;
crCode varchar(50);
crDate date;
step_id number;
BEGIN
step_id := :new.step_id;
select ss.sysid into stepSysid from TEMPLATE.wf_step ws
inner join TEMPLATE.step_stage ss on ss.sysid=ws.stage_id
where ws.sysid= step_id;
if ( stepSysid>0) then
insert into MASTER.fact_cr_progress values(0,:new.instance_id,stepSysid,:new.create_dt);
end if;
dbms_output.enable(10000);
dbms_output.put_line('start print');
END;