A fetch completes the cursor result set and returns one or more rows to the client that is responsible for extracting the column data from the row. Depending on the type of query defined in the cursor, Adaptive Server creates the cursor result set either by scanning the tables directly or by scanning a worktable generated by the query type and cursor type.
In non-scrollable cursors, the fetch command positions the cursor before the first row of the cursor result set. If the table has a valid index, Adaptive Server positions the cursor at the first index key.
In scrollable cursors, fetch can position the cursor anywhere in the cursor result set, depending on the fetch orientation option specified.
Optionally, you can include Transact-SQL parameters or local variables with fetch to store column values.
Copyright © 2005. Sybase Inc. All rights reserved. |