Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace TRIGGER MONITOR
- AFTER UPDATE OF status ON ACTION
- FOR EACH ROW
- DECLARE
- actiontype number(10,0);
- children number(10,0);
- BEGIN
- select code_id into actiontype FROM ACTION_TYPE
- WHERE ACTION_id =:new.ACTION_id
- AND projid = :new.projid
- AND code_id='xxxx';
- IF actiontype=xxxx AND :old.status ='Active' AND :new.status='Finished'
- THEN
- select t.ACTION_id into chlidren from ACTION t left join ACTIONREL tp
- on t.ACTION_id=tp.ACTION_id
- left join ACTIONactv tsk
- on tsk.ACTION_id=t.ACTION_id
- left join project p
- on p.projid=t.projid
- where tp.pred_ACTION_id=:new.ACTION_id
- and t.status = 'TK_NotStart'
- and tsk.code_id='2679933'
- and TRUNC(TO_DATE (p.last_date, 'DD.MON.YYYY'))=TRUNC(TO_DATE (t.target_date, 'DD.MON.YYYY'));
- IF children != NULL
- THEN
- UPDATE ACTION
- SET ACT_START_DATE=TARGET_START_DATE
- WHERE ACTION_ID= children;
- END IF;
- END IF;
Add Comment
Please, Sign In to add comment