Hi,
I have many files but with only 2 names , I want to load the data of that file into database through sqlldr with single control file. how can i do that ?????
Example:
switch_file
switch_file
billing_file
billing_file
now these files should be loaded into same database but different tables.
for i in $(ls /tmp*.switch) ;
do
sed -i "s|FILENAME|$i|g" /tmp/data1.ctl --Read
sqlldr TNS control=/tmp/data1.ctl
sed -i "s|i|FILENAME|g" /tmp/data1.ctl
done
for i in $(ls /tmp*.billing) ;
do
sed -i "s|FILENAME|$i|g" /tmp/data1.ctl --Read
sqlldr TNS control=/tmp/data1.ctl
sed -i "s|i|FILENAME|g" /tmp/data1.ctl
done
COntrol FIle:
load data
infile 'FILENAME' "str '\r\n'"
append
into table TEXT
fields terminated by ' '
trailing nullcols