DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: insert in arrays of 100

  1. #1
    Join Date
    Oct 2000
    Posts
    139
    Hi

    I have to do an insert of 100000 rows and I dont want to use too much rollback segment, I thought is there any PL/SQL script that would allow me to insert 100 rows each time and commit?


    Thanks

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Something like this (replacing leading spaces with "-" for better readability):

    DECLARE
    --CURSOR c IS SELECT col1, col2, col3 FROM source_table;
    BEGIN
    --FOR r IN c LOOP
    ----INSERT INTO dest_table (colA, colB, colC) VALUES (r.col1, r.col2, r.col3);
    ----IF MOD(r%ROWCOUNT,100) = 0 THEN COMMIT;
    ----END IF;
    --END LOOP;
    --COMMIT;
    END;

    HTH,
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width