Home » RDBMS Server » Server Utilities » SQL Loader Error (merged)
SQL Loader Error (merged) [message #301997] Fri, 22 February 2008 11:24 Go to next message
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?

Re: SQL Loader Erro [message #301999 is a reply to message #301997] Fri, 22 February 2008 11:28 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>> Does anyone know how to resolve this?
Not unless you can post the code.
SQL Loader Error [message #302029 is a reply to message #301997] Fri, 22 February 2008 14:04 Go to previous messageGo to next message
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 Erro [message #302030 is a reply to message #301997] Fri, 22 February 2008 14:06 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Krishna_dev wrote on Fri, 22 February 2008 18:24
Does anyone know how to resolve this?

Sure!
Oracle
LRM-00117: syntax error at 'string' at the start of input

Cause: A syntax error was detected.

Action: Change the input so that the correct syntax is used.

Re: SQL Loader Error [message #302036 is a reply to message #302029] Fri, 22 February 2008 14:22 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't start a new topic, continue on the first one.

Regards
Michel

[Updated on: Fri, 22 February 2008 14:23]

Report message to a moderator

Re: SQL Loader Erro [message #302041 is a reply to message #302030] Fri, 22 February 2008 15:02 Go to previous messageGo to next message
Krishna_dev
Messages: 32
Registered: May 2007
Member
Is the error within the data file or the shell script itself. Could further elaborate on a possible fix for this.
Re: SQL Loader Error (merged) [message #302099 is a reply to message #301997] Sat, 23 February 2008 08:55 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
sqlldr ${FCP_LOGIN}, \
control=${V_CONTROL_FILE}, \
data=${V_DATA_FILE}, \
bad=${V_BAD_FILE}, \
log=${V_LOG_FILE}, \
discard=${V_DISCARD_FILE}


I still am working on my 1st cup coffee this morning so I could be mistaken, but I don't think that commas are valid above.
Re: SQL Loader Error (merged) [message #302388 is a reply to message #302099] Mon, 25 February 2008 07:45 Go to previous messageGo to next message
Krishna_dev
Messages: 32
Registered: May 2007
Member
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.
Re: SQL Loader Error (merged) [message #302392 is a reply to message #302388] Mon, 25 February 2008 07:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
SQL*Loader-00520: lfimknam failed for file (string)
Cause: LFI failed to make a name object for the file.
Action: Contact Oracle Worldwide Support.

Regards
Michel
Re: SQL Loader Error (merged) [message #302393 is a reply to message #302388] Mon, 25 February 2008 07:55 Go to previous message
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
Previous Topic: Error while taking the backup of table containing blob database
Next Topic: Why is Datapump faster?
Goto Forum:
  


Current Time: Fri Dec 02 22:53:19 CST 2016

Total time taken to generate the page: 0.08258 seconds