Re: How to know in a unix script if oracle procedure executed or failed?

From: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Wed, 10 Dec 2003 23:49:22 +0100
Message-ID: <3k8ftvkomqr1muvosm0k0hnitddnqab0tp_at_4ax.com>


On 10 Dec 2003 13:18:38 -0800, c_vishal_at_hotmail.com (vishal) wrote:

>Hi,
>
>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
>
>#!/usr/bin/ksh
>sqlplus user/password_at_name <<EOC
>set time on
>set echo on
>select sysdate from dual
>;
>spool procedureName.log
>exec procedureName
>spool off
>exit
>EOC
In the sql script include
whenever sqlerror exit failure
and the script will exit with a non-zero status. If this is not sufficient look up whenever sqlerror and whenever oserror on http://tahiti.oracle.com

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Dec 10 2003 - 23:49:22 CET

Original text of this message