views:

521

answers:

1

In sybase, using a cursor can one delete the currently referenced row? If so what does the cursor end up referencing?

+3  A: 

From manuals.sybase.com - Updating and deleting rows using cursors:

Using the where current of clause of the delete statement, you can delete the row at the current cursor position. When you delete a row from the cursor's result set, the row is deleted from the underlying database table. You can delete only one row at a time using the cursor.

After you delete a row from a cursor, Adaptive Server positions the cursor before the row following the deleted row in the cursor result set. You must still use fetch to access that next row. If the deleted row is the last row in the cursor result set, Adaptive Server positions the cursor after the last row of the result set.

gkrogers