Hi greg,
Informix syntax has the SCROLL CURSOR since the very beginning ( 1984 or so..)
Syntax is:
Code:
DECLARE yourcursor SCROLL CURSOR FOR
SELECT columns list FROM TABLE WHERE
<your where clause (eventually using ? placeholders>
then
Code:
OPEN CURSOR yourcursor ( eventually USING values list )
<some loop code>
FETCH NEXT yourcursor INTO variables
more code here....
<end loop code>
the SCROLL CURSOR can go forward: FETCH NEXT yourcursor
go backwards : FETCH PREVIOUS yourcursor
go relative: FETCH relative +10, FETCH relative -10 yourcursor
go absolute : FETCH ABSOLUTE 23 yourcursor
Caution, a SCROLL CURSOR uses "some temp table like" dataset to move between rows. If you go forwards and backwards and modify a row in the meantime, give preference to only selecting the primary key with the SCROLL cursor and read the row contents from this primary key. If you SELECT * in the SCROLL CURSOR, data will be read from the temp table and may remain stale if updated in the meantime.
Good luck
Eric