Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Status error in a Shell script UNIX
On Wed, 1 Apr 1998 15:30:39 +0200, "thierry merlin" <t.merlin_at_citb.bull.net> wrote:
>my Shell script:
>
>sqlplus -s user/password << FIN
> execute proc_test;
>FIN
>
>=>proc_test must generate an error and I want to test this error ( if $error
>= ... then )
I think you can use WHENEVER SQLERROR to do what you want. At the beginning of your SQL*Plus script, place this command:
WHENEVER SQLERROR THEN EXIT 1 I believe that if your PL/SQL code raises an error, that it will be considered an SQLERROR and SQL*Plus will exit. The value of 1 will be passed back to your shell script.
There are some other options you can use with WHENEVER, take a look at your SQL*Plus manual. Received on Thu Apr 02 1998 - 00:00:00 CST
![]() |
![]() |