Subject | Re: [firebird-support] Advantages of using CURSOR |
---|---|
Author | paul |
Post date | 2013-12-17T03:40:46Z |
Hallo Walter,
If you want to perform positioned updates or deletes, use FOR SELECT ...
AS CURSOR.
DECLARE cursor (with the need for OPEN, FETCH, CLOSE, as well as checking
row_count) is only useful if you want to walk several datasets in parallel.
See
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-psql-forselect.html
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-psql-declare.html#langrefupd25-psql-declare-cursor
HTH,
Paul Vinkenoog
> Then, no makes sense to declare a cursor just for retrieving rows?No, for just retrieving rows FOR SELECT is easier and safer.
If you want to perform positioned updates or deletes, use FOR SELECT ...
AS CURSOR.
DECLARE cursor (with the need for OPEN, FETCH, CLOSE, as well as checking
row_count) is only useful if you want to walk several datasets in parallel.
See
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-psql-forselect.html
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-psql-declare.html#langrefupd25-psql-declare-cursor
> Where I can see an example of WHERE CURRENT OF clause?http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-psql-forselect.html#langrefupd25-psql-forselect-ascursor
HTH,
Paul Vinkenoog