View previous topic :: View next topic
|
Author |
Message |
mastrahoyar
New User
Joined: 03 Mar 2007 Posts: 17 Location: hyd
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Dick,
I believe it's not mandatory to have the 'FOR UPDATE OF' to do a positioned DELETE. |
|
Back to top |
|
|
|