You can use the BULK COLLECT clause with a FETCH statement. Instead of returning a single row at a time from the result set, the FETCH BULK COLLECT returns all rows at once from the result set into the specified collection unless restricted by the LIMIT clause:
If you specify a single collection, then collection can be a collection of a single field, or it can be a collection of a record type. If you specify more than one collection, then each collection must consist of a single field. The expressions in the SELECT list of the cursor identified by name must match all fields in the target collections in number, order, and type-compatibility. If you specify LIMIT n, the number of rows returned into the collection on each FETCH doesn't exceed n.
This example uses the FETCH BULK COLLECT statement to retrieve rows into an associative array: