Quote:
Declare
Cursor del_row is select rowid from temp_tab a where exists
(select 1 from temp_tab b where ((a.amount>0
and b.AMOUNT<0) or(a.amount<0 and b.AMOUNT>0))
and abs(a.amount)=abs(b.AMOUNT)
and a.md=b.MD
and a.comment=b.COMMENT
and a.type=b.TYPE);
ctr number:=0;
Begin
for one_row in del_row loop
delete temp_tab where rowid=one_row.rowid;
ctr:=ctr+1;
if ctr=1000 then
commit;
dbms_output.put_line('1000 rows commited');
ctr:=0;
end if;
end loop;
exception
when others then
dbms_output.put_line(sqlerrm);
end;