Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: frequent commit, example ??? HELP
Andrea,
try the following thur SqlPlus:
set serveroutput on
declare
cursor c1 is
select b.site_id,c.area_code
from site_location b, area c where c.area_id = b.area_id;
rec_count number := 0;
begin
for c1_rec in c1 loop
update site
site_code = c1_rec.area_code where site.site_id = c1_rec.site_id;rec_count := rec_count + 1;
commit; dbms_output.put_line('Commiting'); rec_count := 1;
hope this helps!
Tom Mercadante
Oracle Certified Professional
-----Original Message-----
Sent: Thursday, November 15, 2001 3:00 PM
To: Multiple recipients of list ORACLE-L
Hi all,
Thank you all those for responding to the frequent commit question. So members suggested using count, and loop. May I have real example. (OK, I'm bad at pl/sql). Site table has 2 million rows, how to so a commit, let's say 5000 rows. Site_id is unique in site table. How does the counter fit in the following update sql?
update site a set a.site_code =
(select c.area_code from site_location b, area c where a.site_id = b.site_id andc.area_id = b.area_id);
I put a counter is a sample code, and update runs 10 times! then commit, then runs another 10 times! then commit .... I must miss something. Please give me as mush detail as you can. Thank you so much!
Andrea
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Nov 15 2001 - 14:36:20 CST
![]() |
![]() |