IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQLCODE = 100 while updating with CURRENT OF cursor option


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Mon Apr 16, 2007 12:13 pm
Reply with quote

I have a batch program that uses a cursor. It fetches row depending upon a condition and updates the same with option CURRENT OF cursor.
Now my question is do I need to handle SQLCODE = 100 while updation ?
Is there any possibility that the row fetched by cursor is deleted by another user before it is updated?
Back to top
View user's profile Send private message
ragganga

New User


Joined: 22 Jan 2007
Posts: 18
Location: bangalore

PostPosted: Mon Apr 16, 2007 1:15 pm
Reply with quote

Hi Parag,

It is better to code SQLCODE = 100 because as you told depending on condition it will fetch and do Updates....

Consider a situation, it won't satisfied condition then it is end of record
i.e SQLCODE = 100. so it is needed

For your second question.

When you open any Table, it won't allow any other user to do anything to that table, until your program end

Regards
Raghu
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Fri Apr 20, 2007 11:10 am
Reply with quote

Quote:
For your second question.

When you open any Table, it won't allow any other user to do anything to that table, until your program end


I dont agree with the above sentence. It cant be said like that without considering the isolation levels. I would say it would depend on the isolation level. Its an interesting concept please go thru it. Thanks
Back to top
View user's profile Send private message
ragganga

New User


Joined: 22 Jan 2007
Posts: 18
Location: bangalore

PostPosted: Fri Apr 20, 2007 12:20 pm
Reply with quote

hi vini,

Thanks for making a point in my mistake.

I forgot to write Isolation point.

Regards
Raghu
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts SCOPE PENDING option -check data DB2 2
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top