Skip to Main Content
Oracle in a Nutshell
book

Oracle in a Nutshell

by Rick Greenwald, David C. Kreines
December 2002
Intermediate to advanced content levelIntermediate to advanced
928 pages
85h 29m
English
O'Reilly Media, Inc.
Content preview from Oracle in a Nutshell

BULK COLLECT INTO

                     sql_statement BULK COLLECT INTO collection_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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Internals

Oracle Internals

Donald K. Burleson
Oracle PL/SQL

Oracle PL/SQL

Lewis Cunningham
Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Rick Greenwald, Robert Stackowiak, Jonathan Stern

Publisher Resources

ISBN: 0596003366Errata Page