Home » RDBMS Server » Server Utilities » Using a filename as a parameter with sqlloader
Using a filename as a parameter with sqlloader [message #69689] Mon, 18 February 2002 06:44 Go to next message
kim
Messages: 116
Registered: December 2001
Senior Member
Hi,

I hope someone can help me.

I need to batch process a number of files coming from different companies. The files are the same, but the company id is in the file name. I want to use this as a value in my control file. I can use a Unix script to extract the id from the file name, but I then want to use this in my control file as I want to know who supplied the data. So for example:

The filename is 123_file.dat
the control file is:

load data
into table MY_TABLE
(
company, --value extracted from incoming file name
data1,
data2,
...
)

Any ideas?

Thanks in advance

Kim
Re: Using a filename as a parameter with sqlloader [message #69692 is a reply to message #69689] Mon, 18 February 2002 09:33 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
generate the control file from your unix script.
echo "load data" > load_data.ctl
echo "into table $TABLE_NAME(" >> load_data.ctl
echo "company constant '$COMPANY_NAME'" >> load_data.ctl
...

You'll probably need to escape the '
Previous Topic: Control file inside a control file????
Next Topic: SCOTT and HR
Goto Forum:
  


Current Time: Mon Apr 29 06:52:53 CDT 2024