Home » RDBMS Server » Server Utilities » running sql loader from unix shell script
running sql loader from unix shell script [message #199003] Thu, 19 October 2006 10:23 Go to next message
roopla
Messages: 52
Registered: May 2006
Member
I am trying capture error code from sql loader from unix shell script and display proper messages.

sqlldr parfile=sdb.par control=$cntlfile data=$infile bad=$badFile log=$logFile rows=10000
rows=10000
retcode=`echo $?`
case "$retcode" in
0) echo "SQL*Loader execution successful" ;;
1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
2) echo "SQL*Loader execution exited with EX_WARN, see logfile" ;;
3) echo "SQL*Loader execution encountered a fatal error" ;;
*) echo "unknown return code";;
esac

Eventhough, there are errors while executing sqlldr, it is always returing recode zero. What could be the possible reason

Please advice
Re: running sql loader from unix shell script [message #199018 is a reply to message #199003] Thu, 19 October 2006 11:57 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Not sure why. I just ran sqlldr and specified a non-existant control file and of course it failed and the return code was '1'.

You should try to just set retcode=$?
Previous Topic: Insert diacritic marks
Next Topic: execute immediate with Alter user statement
Goto Forum:
  


Current Time: Tue Jul 02 15:56:28 CDT 2024