Re: calling SQLPLUS from unix - capturing error feedback

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 6 Dec 2002 00:55:37 -0800
Message-ID: <a20d28ee.0212060055.5c9f0098_at_posting.google.com>


northfinchley_at_hotmail.com (P Verstege) wrote in message news:<63bdbacc.0212050747.57c40329_at_posting.google.com>...
> Hello. I have a shell script which calls sqlplus to run a function. My
> problem is that under certain conditions (eg: under the wrong unix
> account), the call to sqlplus will fail. That is fine, but sqlplus
> just returns a 0 no matter what, which does not help. However, it does
> dump a load of error-related feedback to stdio (when I call the script
> under nohup it dumps it to nonup.out).
>
> My question is - how can I trap the feedback?
>
> I have tried a few things:
>
> 1. Spooling to file just before the oracle fuction is called.
> 2. Redirecting sqlplus plus to a file (eg: sqlplus -s $USERID << eof2
> > dump_file.
> 3. Examinging $? after the call to sqlplus.
> 3. Hopping up and down on one leg, whistling "Tie a yellow ribbon".
>
> None of these work. Can you suggest something else, please?
>
>
> Cheers,
>
> Pilatus.

4 looking up whenever sql error in the sql*plus reference manual, and exit with an error status, so you can use 3.

Sybrand Bakker
Senior Oracle DBA Received on Fri Dec 06 2002 - 09:55:37 CET

Original text of this message