November 2003
Intermediate to advanced
816 pages
14h 53m
English
A cursor is a named SELECT statement in which the result set is accessed one row at time. The cursor may be moved, often in a loop, to a different row in the result set using the fetch statement as follows.
FETCH [ NEXT | PREV | FIRST | LAST ]
Cursors may be specified as read only or updateable as well as forward only or scrollable (can move forward and backward) and may be specified to have other features.
|
Note: Cursors are often considered to be inefficient and best avoided if possible. The interested reader is referred to Ben-Gan and Moreau[3] on best use of cursors. They open with the following advice.
In most cases where cursors are being used, they are not really necessary. You should look upon cursors ... |
Read now
Unlock full access