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!

Pass data from excel sheet to pl/sql Procedure as parameter.

VJ4Jan 18 2011 — edited Jan 19 2011
Hello,
I am using ORACLE Database 11g and RHEL 5.

I have a procedure in my database which will update the required table for one value, which users passes from the front end (Java). Now i want to modify it to update multiple records in "BULK".

I have studied the SQL Loader and know about it. But this time i don't want to insert excel data into an oracle table , though i want to pass the excel data to a procedure as a parameter. Also want to do this process in a BULK mode.

Below is a sample code which take input for one value from front end and updated the table ...
PROCEDURE TAB_UPDATE (SYMBOL     IN SYMBOL_INDEX.SYMBOL%TYPE,
END_DATE IN SYMBOL_INDEX.END_DATE%TYPE)
 IS
 BEGIN
     V_QRY1 := '';
     V_QRY2 := '';
     V_QRY1 := 'UPDATE SYMBOL_INDEX';
     V_QRY2 := 'SET END_DATE = '''||END_DATE||''' WHERE SYMBOL_IDENTIFIER = '''||SYMBOL||''' AND END_DATE IS NULL';
     PRO_EXEC(V_QRY1,V_QRY2);
 EXCEPTION
  -----------
 END TAB_UPDATE ;
Now this simple plsql procedure code updates one record at a time ,each time the user has to insert a new value from front end to update its value.

Please suggest me how can i make this procedure to take parameter value from an excel sheet and also update all the records in BULK.

Should i use varrays ? if possible please provide some useful links or sample code ...


Thanks in advance !!!
This post has been answered by Marwim on Jan 18 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2011
Added on Jan 18 2011
19 comments
2,265 views