Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Collection-Inserting multiple rows in single shot within stored procedure

782117Jun 20 2012 — edited Jun 20 2012
Hello,

Below are the data for rows that I want to insert into CUSTOMER_PRODUCT table from a stored procedure.
Instead of making round trips twice to insert these two rows, I looking for a way to pass in the data for both those rows and then insert them from within the stored procedure in one shot.

The stored procedure will be invoked by Java and .NET.

Sample Data for CUSTOMERPRODUCT:_*
ROW 1:
CUSTOMER_ID : 1000
PRODUCT_TYPE : PROD123
IS_MEMERSHIP : Y
IS_EMAIL_SUBSCRIPTION: Y

ROW 2:
CUSTOMER_ID : 1001
PRODUCT_TYPE : PROD123
IS_MEMERSHIP : Y
IS_EMAIL_SUBSCRIPTION: Y

Question 1:
Which is the best way to do it?

Question 2:
Should collection be used? (or) is there any other approach that could be utilized?

Question 3:Can you please provide a sample?

Question 4:
Are there any performance concerns in passing collection and iterating it to fetch value to insert into CUSTOMER_PRODUCT table?

I'm running Oracle 10g.

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2012
Added on Jun 20 2012
7 comments
9,475 views