Click to See Complete Forum and Search --> : commit on every x rows


dragon99
09-27-2000, 04:05 PM
Hi, all
I need to insert some rows into table with commit on every say 100 rows . Can anybody help me with the syntax? Thanx.

carp
09-27-2000, 10:01 PM
If you are using SQL*Plus, you can issue the command
SET AUTOCOMMIT 100

mber
10-12-2000, 02:16 PM
It is very simpple:

Set up a counter, initialized to zero. Then increase the counter
after the inserting option, and do the commit if the counter value is 100, reset the counter to 0 afterwards. Repeat the loop untill all the records be inserted completedly. Note: p.l. commit finally in order to save the last several records which are not being saved yet.

Alternatively, U can use the mod command, but it will impact the performance a bit.

Tahke care