Inserting 50000 rows using FORALL statement

30 pts.
Tags:
FORALL statement
Oracle development
Oracle SQL
PL/SQL
SQL
How can we insert 50000 rows by using FORALL,please give me entire code?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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>

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Ramesh55
    How can we insert 50000 rows by using FORALL,please give me entire code?
    30 pointsBadges:
    report
  • Ramesh55
    where the anonymous bloks are stored?
    30 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following