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?
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 DBAReceived on Wed Dec 10 2003 - 16:49:22 CST
![]() |
![]() |