Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Commit 1000 at a time, thats what I ended up doing
> IF you are looking to break up the update into more 'manageable'
> pieces, here is a thought...
>
> UPDATE EMP2
> SET GENDER = 'F'
> WHERE GENDER = ' '
> AND ROWNUM <= 100;
Yes, that was exactly my objective, to update a large number of records and commit them 1000 at a time. Here is what I did:
DECLARE
RC BINARY_INTEGER := 1;
BEGIN
WHILE RC != 0 LOOP UPDATE EMP3 SET GENDER = 'F' WHERE GENDER = ' ' AND ROWNUM <= 1000; RC := SQL%ROWCOUNT; COMMIT; END LOOP;
If anyone has a better way please let me know, you'are all very helpful.
thx
maa
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: MaryAnn Atkinson INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (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 Wed Jul 09 2003 - 13:35:46 CDT
![]() |
![]() |