Advertisement
psi_mmobile

Untitled

Dec 22nd, 2020
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. procedure unlinkWBSTaskdata(p_wbs_id in number) is
  2. cursor wbs_tasks_c is
  3. select wbs_task_id
  4. from wbs_task
  5. where wbs_id = p_wbs_id;
  6.  
  7. begin
  8. for wbs_task_r in wbs_tasks_c loop
  9. update pd_trf_day set lm_date = SYSDATE, team_day_wbs_task_id = null
  10. where team_day_wbs_task_id in (select team_day_wbs_task_id from team_day_wbs_task where wbs_task_id = wbs_task_r.wbs_task_id);
  11.  
  12. -- update pd_trf_day set lm_date = SYSDATE, wbs_id = null
  13. -- where wbs_id = p_wbs_id;
  14.  
  15. update mf_owner.mw_time_sheet_line set lm_date = SYSDATE, team_day_wbs_task_id = null
  16. where team_day_wbs_task_id in (select team_day_wbs_task_id from team_day_wbs_task where wbs_task_id = wbs_task_r.wbs_task_id);
  17.  
  18. delete from team_day_wbs_task
  19. where wbs_task_id = wbs_task_r.wbs_task_id;
  20.  
  21. delete from wbs_task
  22. where wbs_task_id = wbs_task_r.wbs_task_id;
  23.  
  24. commit;
  25. end loop;
  26.  
  27. update wbs set lm_date = SYSDATE, wbs_status_id = 1
  28. where wbs_id = p_wbs_id;
  29. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement