SQL*Loader error: What is wrong here?

Hello All,

 

I need some help with a SQL*Loader error.

 

I am trying to execute SQL* Loader from a shell script on a directory of
files by passing in the DATA command to the SQLLDR. Below, is my shell
script and the control file. I am running this on 10g (Can't use External
Tables since our prod is still on 8i). 

 

 

 

My shell script, which is very basic:

#!/bin/bash

CTLFILE=ld_inbound2.ctl 

CTL_LOG=ld_inbound.log

LOGIN=user/pass@dev     # Get this from a more secure location 

 

# load each inbound text files.

echo $LOGIN

echo $CTLFILE

echo $CTL_LOG

 

for  f in `ls i*.txt` 

do

sqlldr $LOGIN CONTROL=$CTLFILE LOG=$CTL_LOG data=$f

done

exit 0

 

I understand that if I pass in the DATA command, it will override the INFILE

Control file:

LOAD DATA 

INFILE *

Append

INTO TABLE INBOUND

FIELDS TERMINATED BY ","

TRAILING NULLCOLS

 

This script is erring out on:

SQL*Loader-350: Syntax error at line 5.

Expecting "(", found end of file.

 

What am I doing wrong here?

I kind-of reached a wall out on this, so if someone can shed some light on
what I am doing wrong, I'll greatly appreciate it. 

 

Thank you in advance.

 

-madhavi

Other related posts: