DB2 COMMIT??

IBM's flagship relational database management system
ninudvictor
Posts: 7
Joined: Thu Oct 09, 2008 1:40 pm
Skillset: Cobol,Db2,Jcl,CICS,VSAm,MVS,PL1
Referer: Internet Search

DB2 COMMIT??

Postby ninudvictor » Mon Oct 20, 2008 9:36 pm

Hi All,
I am doing UPDATE in two tables in a single program (Program with Checkpoint Restart Logic).
I want to commit the changes after processing five records.So is it reuired to mention two COMMIT
to save the changes in two different table?

My question is - If there are 'n' no. of tables to be updated, is it reuired to give 'n' no. of
EXEC SQL
COMMIT WORK
END-EXEC
?
Or only one COMMIT is sufficient to save all the changes made to 'n' no. of tables.

Many Thanks in advance.
Nihar

User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am

Re: DB2 COMMIT??

Postby dick scherrer » Tue Oct 21, 2008 2:58 am

Hello,

One COMMIT handles everything that has been added/deleted/changed since the last checkpoint.

If you are implementing checkpoint/restart, keep in mind that files other than database tables must be syncronized on a restart. This is also tru of any report(s) being created by the process.
Hope this helps,
d.sch.


  • Similar Topics
    Replies
    Views
    Last post