FETCH BULK COLLECT v13
The BULK COLLECT
clause can be used with a FETCH
statement. (See Fetching Rows From a Cursor for information on the FETCH
statement.) Instead of returning a single row at a time from the result set, the FETCH BULK COLLECT
will return all rows at once from the result set into the specified collection unless restricted by the LIMIT
clause.
If a single collection is specified, then collection
may be a collection of a single field, or it may be a collection of a record type. If more than one collection is specified, then each collection
must consist of a single field. The expressions in the SELECT
list of the cursor identified by name
must match in number, order, and type-compatibility all fields in the target collections. If LIMIT n
is specified, the number of rows returned into the collection on each FETCH
will not exceed n
.
The following example uses the FETCH BULK COLLECT
statement to retrieve rows into an associative array.