DB2 commit question

3 posts / 0 new
Last post
DB2 commit question


A COBOL DB2 program is updating the rows in a table, and there are total 1000 records in the table and I have a DB2 COMMIT issued after every 150 rows update.

Would any rows be updated if the job abends after updating say 200 records and if the program is restarted from top would all the 200 records be updated again.
"; ; ; ;
DB2 Comi

No. It will not update all 200 records from starting because you have given DB2comit  after 150 records. so after 150 it will update. Update will strat from 151.

re:DB2 commit question


Only 150 recs will be updated by the program if the job abends after 200 rows updation since the commit is only after 150 rows.
You should have a restart logic written in the program so that you do not update the already update 150 rows in the program and 
this can be achieved by maintaining a counter after commit.
Log in or register to post comments
Sponsored Listing