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

From: Thorsten Häs <eifel-power_at_t-online.de>
Date: Thu, 11 Dec 2003 19:28:33 +0100
Message-ID: <oprz039vdayk58sc_at_news.t-online.de>


Hello,

you can use some other solution:

#!/usr/bin/ksh
>> sqlplus user/password_at_name <<EOC>/tmp/log/log_file_unix_shell.log
>> set time on
>> set echo on
>> select sysdate from dual
>> ;
>> spool procedureName.log
>> exec procedureName
>> spool off
>> exit
>> EOC
you find the output of your user(SQL)-session in the /tmp/log/log_file_unix_shell.log-File.

best regards
thorsten häs

On Wed, 10 Dec 2003 23:49:22 +0100, Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl> wrote:

> 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

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Received on Thu Dec 11 2003 - 19:28:33 CET

Original text of this message