View previous topic :: View next topic |
Author |
Message |
jagan Beginner
Joined: 27 Jan 2003 Posts: 5 Topics: 4
|
Posted: Wed Mar 19, 2003 4:43 am Post subject: cursors with update |
|
|
i have 100 records in my table and i am using a cursor and i am updating one column in that table.
for the first 50 records it is working fine and i got a problem in 51th record while updating and my program is abending.
after solving that problem i have to run the same program but already i updated 50 records but i want the intial stage of my table.
how can i achieve this.
shall i use rollback at 51th record. so that it will not update the 50 records am i right? so i can use the same program. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Mar 19, 2003 6:32 am Post subject: |
|
|
jagan,
As long as you dont issue an exclusive COMMIT or SYNCPOINT(cics program) or CHECKPOINT(IMS program) then DB2 automatically rollsback if the program abends in the middle.
so your program is in the initial state itself
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
vallishar Beginner
Joined: 17 Dec 2002 Posts: 53 Topics: 14 Location: BengaLuru
|
Posted: Wed Mar 19, 2003 11:03 am Post subject: |
|
|
Jagan,
If the abend is happening because of a timeout condition resulting in SQL code of -913 and if you are program is in batch mode, then DB2 does not rollback. In such a condition you might have to issue an explict rollback. _________________ If you're not failing every now and again, it's a sign you're not doing anything very innovative. |
|
Back to top |
|
|
|
|