Home » RDBMS Server » Server Utilities » Execute package using sqlldr and input csv (sql loader, unix)
icon5.gif  Execute package using sqlldr and input csv [message #552138] Mon, 23 April 2012 15:25 Go to next message
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
Re: Execute package using sqlldr and input csv [message #552139 is a reply to message #552138] Mon, 23 April 2012 15:38 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/


one possible solution would be EXTERNAL TABLE
Previous Topic: second enclosure string not present in sqlldr
Next Topic: expdp query
Goto Forum:
  


Current Time: Thu Mar 28 13:24:39 CDT 2024