Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to know in a unix script if oracle procedure executed or failed?
vishal <c_vishal_at_hotmail.com> wrote:
: I am writing my first script to execute a Oracle procedure through a
: unix script. Could you tell me how do I do error handling here? How do
: I know in my script if the procedure executed successfully or failed?
: Thanks
What I do is run the script with the output piped to a log file and within
the script itself, test for errors...
Within the stored procedure itself, there's a bunch of EXCEPTION handling
clauses with more specific error messages.
$HOME/bin/qs "execute load_table('X')"
echo "load_table has executed"
if [ $? -ne 0 ]
then
echo "An error has occurred"
exit
fi
err=`grep 'ORA-' $HOME/logfile|wc -1
if [ $err -ne 0 ]
then
echo "An ORACLE error has occurred"
exit
fi
Hope this helps! Received on Fri Dec 19 2003 - 07:07:58 CST