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

To update a particular row using cursor.


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

New User


Joined: 26 Feb 2007
Posts: 4
Location: India

PostPosted: Mon Mar 19, 2007 7:22 pm
Reply with quote

Hi,

I am using a cursor and say I am fetching 5 rows from the table.
I want to update the 3rd row .
How do I acheive this ? I can check the value and then update saying current of. But is there any other way ?

-Shalini
Back to top
View user's profile Send private message
dineshness

New User


Joined: 25 Dec 2006
Posts: 63
Location: Perambalur

PostPosted: Tue Mar 20, 2007 12:27 am
Reply with quote

If you are sure that you are always going to update the third row of the result set, then may be you can code a typical select statement without the use of cursor to get the values from database and update it directly with an update statement.

But by using the cursor, You have to fetch the row that you want to update and use the "Where current of" option.

Dinesh.
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