Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Controlling COMMIT frequency

WilhelmSep 4 2007 — edited Nov 27 2009
Hi,
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2009
Added on Sep 4 2007
33 comments
9,610 views