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;
/