Execute package using sqlldr and input csv [message #552138] |
Mon, 23 April 2012 15:25 |
namitanamburi
Messages: 35 Registered: March 2009
|
Member |
|
|
Hello,
I have written a shell script that will execute a procedure. The input parameters are constant.
__________________________________
#!/bin/ksh
sqlplus user@server.com<<EOF
set serveroutput on;
var Return_Code number;
var Return_Message varchar2(4000);
exec test_pkg.Insert_test('IDD', null, 'BATCH',:Return_Code, :Return_Message);
__________________________________
Now I have to call same procedure but the input is a csv file.
Is there a way to call a procedure using csv file, I cannot load the table using SQL Loader because there is a complicated logic.For every row in CSV there should be 3 rows inserted into table and 2 rows updated.
As of JAN 2, three rows have to be inserted with dates JAN2, JAN 3, JAN 4 and 2 rows ( 3ODEC and 29DEC have to be updated). Also these days have to be business days.
So all this code is in procedure that uses a DB2 package for business dates.Instead of using sql ldr , if would like pass the csv file as input param.
Please let me know how to achieve this.
Thanks
Nammu
|
|
|
|