commit and sqlrpgle

Posted on 2012-09-20
Last Modified: 2012-09-20
I have an sqlrpgle program.
It makes several sql statment.
Sometime, one of this statment goes in error
and the program aborts.
Is there a way with commit settings
in order to confirm all the operation only
at the end of the program and only if there was no error?
Question by:bobdylan75
    LVL 18

    Accepted Solution

    When you compile your sqlrpgle program, you'll need to specify a commitment control level of something other than *NONE. Personally, I use *CHG, but you can use whichever works best for you.

    Then, in your program, you'd simply issue a "commit" via SQL after doing all you inserts and updates.


    That way, if any of the inserts or updates fail, they'll all get rolled back.

    LVL 34

    Assisted Solution

    by:Gary Patterson

    If the number of update/delete/inserts you are performing is small, then use commitment control and wrap the entire process in a commitment boundary.

    Here is an IBM example of a SQLRPGLE program that uses commitment control:

    If this is a large batch process, bear in mind that using commitment control to simultaneously commit a large number of changes is undesirable from a system performance standpoint.  In this case, it is best to design your program to allow it to commit smaller batches of data at a time.


    - Gary Patterson

    Author Closing Comment

    thank you very much

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
    Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    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

    11 Experts available now in Live!

    Get 1:1 Help Now