A cursor can be positioned at one of three places:
On a row
Before the first row
After the last row
When a cursor is opened, it is positioned before the first row. Using the FETCH command, you can move the cursor position to an absolute position from the start or the end of the query results (using FETCH ABSOLUTE, FETCH FIRST, or FETCH LAST), or to a position relative to the current cursor position (using FETCH RELATIVE, FETCH PRIOR, or FETCH NEXT). The NEXT keyword is the default qualifier for the FETCH statement.
For more information see “FETCH statement [ESQL] [SP],” in Sybase IQ Reference Manual.
Sybase IQ treats the FIRST, LAST, and ABSOLUTE options as starting from the beginning of the result set. It treats RELATIVE with a negative row count as starting from the current position.
There are special positioned versions
of the UPDATE and DELETE statements that
can be used to update or delete the row at the current position
of the cursor. If the cursor is positioned before the first row
or after the last row, a No current row of cursor
error
is returned.