Thursday, September 4, 2008

Commit every X records for UPDATE/DELETE in a loop

Generally Huge updates/deletes causes rollback segment or data-files related errors.

Below is the code which is used to comming after every 1000 rows of update/delete to over come the problems. Place the code in below the update or delete statement in the procedure:

if mod(i, 1000)
commit;
dbms_output.put_line('Commit issued for rows up to: 'c1%rowcount);
end if;

No comments: