Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Commit 1000 at a time, thats what I ended up doing

Re: Commit 1000 at a time, thats what I ended up doing

From: MaryAnn Atkinson <maryann_30_at_yahoo.com>
Date: Wed, 09 Jul 2003 11:35:46 -0700
Message-ID: <F001.005C4194.20030709112925@fatcity.com>


> 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;

END;
/

If anyone has a better way please let me know, you'are all very helpful.

thx
maa


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
-- 
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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US