Collection-Inserting multiple rows in single shot within stored procedure
782117Jun 20 2012 — edited Jun 20 2012Hello,
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!