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!

Difference between COMMIT and COMMIT WRITE BATCH

694224Jan 21 2010 — edited Jan 21 2010
Hey folks,

Tried finding a answer for this question but none seems to have a proper answer. I know in batch mode the sql statements are actually buffered in redo log file but can i get more elaborate answer as to what really happens inside?

Assume the following scenario:-
BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE temp_rc';
INSERT INTO TEMP_RC VALUES(1,'A',240000);
INSERT INTO TEMP_RC VALUES(2,'B',60000);
INSERT INTO TEMP_RC VALUES(3,'C',50000);
COMMIT WRITE BATCH;
INSERT INTO TEMP_RC VALUES(4,'D',20000);
END;
/


Table structure of temp_rc:-
CREATE TABLE temp_rc
(id NUMBER
,name VARHCAR2(100)
,sal NUMBER)
/


In the above scenario what will be the difference between COMMIT and COMMIT WRITE BATCH. Any other example would be much appreciated.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 18 2010
Added on Jan 21 2010
10 comments
4,356 views