Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: FORALL Jump to:  
Category: >> Oracle PL/SQL >> FORALL Bookmark and Share

<< lastnext >>

Snippet Name: FORALL

Description: FORALL transfers data from a PL/SQL collection to the specified table using collections. The following code example shows a procedure that accepts a nested table of book information and inserts the full contents of that collection (the binding array) into the book table. Note that this example also takes advantage of Oracle9i's FORALL enhancement that allows the INSERT of a record directly into a table.

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 02nd, 2009

FORALL <index_name> IN <lower_boundary> .. <upper_boundary>
 
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;
 
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 235 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?