30 pts.
 Inserting 50000 rows using FORALL statement
How can we insert 50000 rows by using FORALL,please give me entire code?

Software/Hardware used:
ASKED: February 18, 2009  5:48 AM
UPDATED: February 18, 2009  9:36 PM

Answer Wiki:
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  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

How can we insert 50000 rows by using FORALL,please give me entire code?

 30 pts.

 

where the anonymous bloks are stored?

 30 pts.