EXECUTE IMMEDIATE BULK COLLECT v17
You can use the BULK COLLECT
clause with an EXECUTE IMMEDIATE
statement to specify a collection to receive the returned rows:
EXECUTE IMMEDIATE '<sql_expression>;' BULK COLLECT INTO <collection> [,...] [USING {[<bind_type>] <bind_argument>} [, ...]}];
Where:
collection
specifies the name of a collection.
bind_type
specifies the parameter mode of the bind_argument
.
- A
bind_type
ofIN
specifies that thebind_argument
contains a value that's passed to thesql_expression
. - A
bind_type
ofOUT
specifies that thebind_argument
receives a value from thesql_expression
. - A
bind_type
ofIN OUT
specifies that thebind_argument
is passed tosql_expression
and then stores the value returned bysql_expression
.
bind_argument
specifies a parameter that contains a value that either:
- Is passed to the
sql_expression
(specified with abind_type
ofIN
) - Receives a value from the
sql_expression
(specified with abind_type
ofOUT
) - Does both (specified with a
bind_type
ofIN OUT
). Currentlybind_type
is ignored andbind_argument
is treated asIN OUT
.
If you specify a single collection, then collection
can be a collection of a single field or a collection of a record type. If you specify more than one collection, each collection
must consist of a single field.