Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To update a particular row using cursor.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: To update a particular row using cursor.
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us