Commit Frequency in PL/SQL

Posted on 2004-11-11
Last Modified: 2006-11-17

I have a PL/SQL procedure that will open up a cursor and process records one at a time to load them into another table.  I will be processing ~4,000 - 5,000 records per run.  I don't want to commit each record, but I also don't want to wait until the end to commit.

How can I set the commit frequency in my PL/SQL procedure to commit, say, every 500 records?

Question by:ccorrente
    1 Comment
    LVL 4

    Accepted Solution

    for c1rec in c1_cursor loop
       i := i+1;
       if mod(i,500)
       end if;
    end loop;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now