Oracle® Database SQL Reference 10g Release 2 (10.2) Part Number B14200-02 |
|
|
View PDF |
Syntax
Purpose
COLLECT
takes as its argument a column of any type and creates a nested table of the input type out of the rows selected. To get the results of this function you must use it within a CAST
function.
If column
is itself a collection, then the output of COLLECT
is a nested table of collections.
See Also:
CASTExamples
The following example creates a nested table from the varray column of phone numbers in the sample table oe.customers
:
CREATE TYPE phone_book_t AS TABLE OF phone_list_typ; / SELECT CAST(COLLECT(phone_numbers) AS phone_book_t) FROM customers;