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

help required for cursor with update of...


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

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Tue Jul 28, 2009 1:54 pm
Reply with quote

Hi,
I have a cursor that is fetching some rows from a table and at the time of declaration I have given as for update of the same table from which I am fetching the values.

Now what process is like that I fetch a value from the table and perform some operation and then insert/update the values in that table, after the update/insert I do the commit.
So I would like to ask is that when I commit that table, will those updated value be there in the cursor .

Regards
Ketan Varhade
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Jul 28, 2009 2:17 pm
Reply with quote

Ketan,
Once you use Fetch cursor and update the current row, it doesn't really matter for you if its updated in the cursor or not, as you will not be able to access that row again unless you re-open the cursor or use a select statement to read that row, which will definitely have the updated value as its committed.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Jul 28, 2009 3:43 pm
Reply with quote

Whenever you issue a commit, all the open cursors will be closed, unless its a
Code:
CURSOR WITH HOLD
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 Read a flat file and update DB2 table JCL & VSAM 2
No new posts how to update an ISR appl var from an... TSO/ISPF 8
No new posts DB2 SQL query to read and update data... DB2 12
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
No new posts Group comparison/update between two f... DFSORT/ICETOOL 10
Search our Forums:

Back to Top