Re: Status error in a Shell script UNIX

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 1998/04/02
Message-ID: <6fusuu$1kd_at_bgtnsc03.worldnet.att.net>#1/1


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 CEST

Original text of this message