commit on every x rows
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: commit on every x rows

  1. #1
    Join Date
    Feb 2000
    Location
    New York,U.S.A.
    Posts
    245
    Hi, all
    I need to insert some rows into table with commit on every say 100 rows . Can anybody help me with the syntax? Thanx.

  2. #2
    Join Date
    Nov 1999
    Location
    Elbert, Colorado, USA
    Posts
    81
    If you are using SQL*Plus, you can issue the command
    SET AUTOCOMMIT 100

  3. #3
    Join Date
    Oct 2000
    Posts
    123

    Smile

    It is very simpple:

    Set up a counter, initialized to zero. Then increase the counter
    after the inserting option, and do the commit if the counter value is 100, reset the counter to 0 afterwards. Repeat the loop untill all the records be inserted completedly. Note: p.l. commit finally in order to save the last several records which are not being saved yet.

    Alternatively, U can use the mod command, but it will impact the performance a bit.

    Tahke care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width