Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. DECLARE
  2. CURSOR c6
  3. IS
  4. SELECT /*+parallel(a,32)*/
  5. a.rowid,a.*
  6. FROM EB_O.CCO_DIR_CONTRS_ES_GG a
  7. WHERE a.GG_CREATE_DATE < SYSDATE-30
  8. AND ROWNUM <=200001;
  9.  
  10. TYPE contact_point_id_tab IS TABLE OF c6%ROWTYPE
  11. INDEX BY PLS_INTEGER;
  12.  
  13. l_contact_point_id_tab contact_point_id_tab;
  14. BEGIN
  15. OPEN c6;
  16.  
  17. LOOP
  18. FETCH c6
  19. BULK COLLECT INTO l_contact_point_id_tab
  20. LIMIT 10000;
  21.  
  22. EXIT WHEN l_contact_point_id_tab.COUNT = 0;
  23.  
  24. IF l_contact_point_id_tab.COUNT > 0
  25. THEN
  26. FORALL i
  27. IN l_contact_point_id_tab.FIRST .. l_contact_point_id_tab.LAST
  28. DELETE FROM EB_O.CCO_DIR_CONTRS_ES_GG
  29. WHERE rowid =l_contact_point_id_tab (i).rowid;
  30.  
  31. COMMIT;
  32. END IF;
  33.  
  34. l_contact_point_id_tab.delete;
  35. END LOOP;
  36. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement