Commit to 10,000 in 10,000 records in pl/sql

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
  

Poston Mon, 24 Oct 2005 9:59 am

Good day I would like to ask if anyone has any tips for a pl/sql block do commit every 10,000 records.
I used the option below, but was very slow:
Code: Select all
IF mod(c_Actype%rowcount,10000)= 0 then
    COMMIT;
END IF;
Thanks, Marcia
Márcia de Paiva Salles
Location: DF

Poston Mon, 24 Oct 2005 1:49 pm

You can use a counter.

Code: Select all
  if vcont=10000
  then
    vcont=0;
    commit;
  end if;

  vcont:=vcon+1;
Maybe was slow because of the 10,000. Maybe a commit of 1000 in 1000 or 2 thousand is faster, because it so you do not abuse the rollback.
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered

Poston Mon, 24 Oct 2005 3:44 pm

Thanks, dr_gori! I auditioned with the two options and the time was practically the same, but I figured out the problem ... was missing an index:(!
Márcia de Paiva Salles
Location: DF



Return to PL/SQL

Who is online

Users browsing this forum: Google [Bot] and 8 guests