-
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
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|