Mayur_Pipaliya

PL/SQL - Chunk INSERT

Feb 5th, 2013
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT Query : SELECT a,b,c,d,e FROM TABLE t2, TABLE t3, TABLE t4 WHERE conditions ;
  2. INSERT Query : INSERT INTO TABLE t1 (SELECT a,b,c,d,e FROM TABLE t2, TABLE t3, TABLE t4 WHERE conditions)
  3.  
  4.  
  5.  
  6. // Batch Process 0-500
  7. INSERT INTO TABLE t1
  8. (
  9.     SELECT * FROM
  10.     ( SELECT a.*, ROWNUM rnum FROM
  11.         ( SELECT a,b,c,d,e FROM TABLE t2, TABLE t3, TABLE t4 WHERE conditions ) a
  12.       WHERE ROWNUM <= 500 )
  13.     WHERE rnum  >= 0;
  14. )
  15.  
  16. // Batch Process 501-1000
  17. INSERT INTO TABLE t1
  18. (
  19.     SELECT * FROM
  20.     ( SELECT a.*, ROWNUM rnum FROM
  21.         ( SELECT a,b,c,d,e FROM TABLE t2, TABLE t3, TABLE t4 WHERE conditions ) a
  22.       WHERE ROWNUM <= 1000 )
  23.     WHERE rnum  >= 501;
  24. )
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×