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
 

 

How can we declare a cursor for deleting row using cursor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
mastrahoyar

New User


Joined: 03 Mar 2007
Posts: 17
Location: hyd

PostPosted: Fri Oct 10, 2008 4:10 pm    Post subject: How can we declare a cursor for deleting row using cursor
Reply with quote

I want to delete some rows by using cursor.

Please let me know the syntax to declare a cursor for deleting a row..

For update any column we declare cursor as "Declare c1 cursor for select * from table where condition
for update of column-name"

Can we use same syntax "for delete of column-name" for deleting rows by cursor.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Oct 10, 2008 4:21 pm    Post subject:
Reply with quote

i believe the syntax is still for update of column-name.

I have always listed all the columns. don't know if it is required, but when someone else looks at the cursor declaration it is obvious something is going to happen to the complete row.

you could also check the db2 manuals - for a complete definition and description of the declare cursor statement in regard to issuing delete where current cursor.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Fri Oct 10, 2008 4:35 pm    Post subject:
Reply with quote

Dick,

I believe it's not mandatory to have the 'FOR UPDATE OF' to do a positioned DELETE.
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 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 DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm
No new posts ISREDIT - Position Cursor on the Comm... Tarique Anwer TSO/ISPF 5 Wed Feb 03, 2016 12:44 pm
No new posts Savings by Deleting Unused datasets swathykrishnan All Other Mainframe Topics 13 Fri Jul 10, 2015 6:26 pm


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