Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Need Guidance regarding UPDATE query Poha Eater DB2 3 Mon Feb 12, 2018 11:35 pm
No new posts Conversion of DLI update Jobs as BMP ... Gopinath Shanmugam IMS DB/DC 3 Wed Dec 20, 2017 12:02 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us