You will need to have the data in a collection in order to use the FORALL operator.
Here's a simple example of the use of FORALL in an INSERT statement.
<pre>CREATE TYPE books_nt
IS TABLE OF book%ROWTYPE;
/
CREATE OR REPLACE PROCEDURE add_books (
books_in IN books_nt)
IS
BEGIN
FORALL book_index
IN books_in.FIRST .. books_in.LAST
INSERT INTO book
VALUES books_in(book_index);
...
END;</pre>
To read more about the FORALL operator, and the enhancements that were made to it in 10g, visit:
<a href="http://www.oracle.com/technology/oramag/oracle/04-jan/o14tech_plsql.html">Oracle 10g Adds More to FORALL </a>
Heres is another link with an example of inserts with FORALL:
<a href="http://www.dba-oracle.com/oracle_news/news_plsql_forall_performance_insert.htm">PL/SQL forall operator speeds 30x faster for table inserts</a>
Last Wiki Answer Submitted: February 18, 2009 9:36 pm by carlosdl63,535 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
How can we insert 50000 rows by using FORALL,please give me entire code?
where the anonymous bloks are stored?