MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

cursors with update

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
jagan
Beginner


Joined: 27 Jan 2003
Posts: 5
Topics: 4

PostPosted: Wed Mar 19, 2003 4:43 am    Post subject: cursors with update Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Mar 19, 2003 6:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vallishar
Beginner


Joined: 17 Dec 2002
Posts: 53
Topics: 14
Location: BengaLuru

PostPosted: Wed Mar 19, 2003 11:03 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group