BULK COLLECT INTO
sql_statementBULK COLLECT INTOcollection_name_list;
When PL/SQL processes this statement, the whole collection, instead of each individual collection element, is returned from the database server for processing. You can include the BULK COLLECT INTO clause in the SELECT INTO, FETCH INTO, or RETURNING INTO statements. You can use the BULK COLLECT INTO clause with dynamic SQL executed with the EXECUTE IMMEDIATE syntax.
You can use the SQL%BULK_ROWCOUNT cursor attribute for bulk bind operations. That attribute is like an associative array containing the number of rows affected by the executions of the bulk bound statements. The nth element of SQL%BULK_ROWCOUNT contains the number of rows affected by the nth execution of the SQL statement.
You cannot pass SQL%BULK_ROWCOUNT as a parameter to another program, nor can you use an aggregate assignment to another collection. %ROWCOUNT contains a summation of all %BULK_ROWCOUNT elements. %FOUND and %NOTFOUND reflect only the last execution of the SQL statement
Keywords
- sql_statement
SQL statement such as SELECT INTO, FETCH INTO, RETURNING INTO, or EXECUTE IMMEDIATE.
- collection_name_list
Comma-delimited list of collections, one for each column in the SELECT. Collections of records cannot be a target of a BULK COLLECT INTO clause. However, Oracle does support retrieving a set of typed objects and “bulk collecting” them into a collection of objects.