Controlling COMMIT frequency
WilhelmSep 4 2007 — edited Nov 27 2009Hi,
I have two questions for you guys
1. One of the IN parmaters for my stored procedure is commit frequency.If the user enters 100 (COMMIT after every 100 INSERTS). I want to know how you do this. I found this from the internet:
FOR i IN 1..myarray.count
LOOP
DBMS_OUTPUT.PUT_LINE('event_key at' || i || ' is: ' || myarray(i));
INSERT INTO emp
(
empid,
event_id,
dept,
event_key
)
VALUES
(
v_empid,
3423,
p_dept,
myarray(i)
);
if(MOD(i, p_CommitFreq) = 0)
then
commit;
end if;
END LOOP;
Is this the usual way of implementing commit frequency?
2. If i use FORALL i wouldn't be able to use the above mentioned method to control the COMMIT frequency. Would i?