SQL Loader Error (merged) [message #301997] |
Fri, 22 February 2008 11:24 |
Krishna_dev
Messages: 32 Registered: May 2007
|
Member |
|
|
I am using sql loader within a unix shell script. I am getting the following error:
LRM-00117: syntax error at ',' at the start of input
Does anyone know how to resolve this?
|
|
|
|
SQL Loader Error [message #302029 is a reply to message #301997] |
Fri, 22 February 2008 14:04 |
Krishna_dev
Messages: 32 Registered: May 2007
|
Member |
|
|
I am trying to load a table with SQL Loader run from Unix. I keep on getting the same error. Does anyone know how to resolve this. The error is:
LRM-00117: syntax error at ',' at the start of input
Here is the code below:
****************************************************************
#!/bin/ksh
PARA_STRING=${1}
V_DATA_DIR=`echo $PARA_STRING|cut -f9 -d" "|tr -d '"'`
cd $V_DATA_DIR
#Initializing the local counter to keep track if multiple
#data files found
V_COUNTER=1
#Looking out for the .txt files in the given inbound directory
if [ -f *.txt ] ; then
echo "Looping through each .txt file ..."
for V_DATA_FILE in *.txt ; do
echo "File number:"$V_COUNTER
echo "Data file:"$V_DATA_FILE
V_BASE_NAME=`echo $V_DATA_FILE|tr -d ".txt"`
V_CONTROL_FILE=${V_DATA_DIR}/${V_BASE_NAME}.ctl
V_LOG_FILE=${V_DATA_DIR}/${V_BASE_NAME}.log
V_BAD_FILE=${V_DATA_DIR}/${V_BASE_NAME}.bad
V_DISCARD_FILE=${V_DATA_DIR}/${V_BASE_NAME}.discard
echo SQL*Loader control file: $V_CONTROL_FILE
echo SQL*Loader log file: $V_LOG_FILE
echo SQL*Loader bad file: $V_BAD_FILE
echo SQL*Loader discard file: $V_DISCARD_FILE
cat >${V_CONTROL_FILE} << !
LOAD DATA
INFILE '${V_DATA_FILE}'
APPEND
INTO TABLE XXATC_AP_CE_BANK_INTERFACE_TAB
WHEN RECORD_TYPE = 'R'
(
RECORD_TYPE POSITION(1:1) CHAR,
STATEMENT_NUMBER "TO_CHAR(SYSDATE,'MMDDYYYY')",
ACCOUNT_NUMBER POSITION(3:22) CHAR,
CHECK_NUMBER POSITION(24:41) CHAR,
AMOUNT POSITION(43:60) CHAR,
ISSUE_DATE POSITION(62:69) CHAR,
PAID_DATE POSITION(71:78) CHAR,
ADDITIONAL_DATA POSITION(80:94) CHAR,
PAYEE_NAME POSITION(95:144) CHAR,
PROCESS_FLAG CONSTANT 'U',
LINE_NUMBER "XXATC_BANK_RECON_S.NEXTVAL"
)
!
[ -f ${V_BAD_FILE} ] && rm -f ${V_BAD_FILE}
[ -f ${V_LOG_FILE} ] && rm -f ${V_LOG_FILE}
[ -f ${V_DISCARD_FILE} ] && rm -f ${V_DISCARD_FILE}
sqlldr ${FCP_LOGIN}, \
control=${V_CONTROL_FILE}, \
data=${V_DATA_FILE}, \
bad=${V_BAD_FILE}, \
log=${V_LOG_FILE}, \
discard=${V_DISCARD_FILE}
err=$?
echo Error value = $err
V_COUNTER=$(expr $V_COUNTER + 1)
done
fi
echo $V_COUNTER
exit ${err}
****************************************************************
|
|
|
|
|
|
|
|
|
Re: SQL Loader Error (merged) [message #302393 is a reply to message #302388] |
Mon, 25 February 2008 07:55 |
|
MarcS
Messages: 312 Registered: March 2007 Location: Antwerp
|
Senior Member |
|
|
Krishna_dev wrote on Mon, 25 February 2008 14:45 | I have tried removing the commas that you specified. Only now I am receiving the following error:
SQL*Loader-520: lfimknam failed for file (/.log)
Can you help me troubleshoot this. Thanks.
|
Apparently something isn't properly defined within your script.
I think if you display ${V_LOG_FILE} you'll get /.log
V_LOG_FILE=${V_DATA_DIR}/${V_BASE_NAME}.log
So both ${V_DATA_DIR} as ${V_BASE_NAME} seems to be empty.
You could prove me wrong by displaying their values with an echo command
|
|
|