Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
mastrahoyar

New User


Joined: 03 Mar 2007
Posts: 8
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
References
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1639
Location: germany

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
arcvns

Senior Member


Joined: 17 Oct 2006
Posts: 759
Location: Chennai, India

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1