I am Selecting number of rows from a table and inserting into another table in a pl/sql block.I want to commit only limited number of rows at a time(say 2000).how can this be achieved.
create or replace procedure myproc as
x number(4);
begin
loop
insert into newtable values( . . . );
x := x+1;
if mod(x,2000) = 0 then
___commit;
end if;
exit when . . .
end loop;
end;
/
create or replace procedure test
x number;
begin
insert into testtable......
select count(*) into x from testtable;
if mod(x,2000)=0 then commit;
end if;
end;
Bookmarks