Re: calling SQLPLUS from unix - capturing error feedback

From: Speakeasy <hvetsa_at_speakeasy.net>
Date: Thu, 05 Dec 2002 12:53:41 -0800
Message-ID: <oprgx9nrfrsy3jti_at_news.speakeasy.net>


Here is what works

Output=`$ORACLE_HOME/bin/sqlplus -s userid/password_at_Database" @sqlscript`

The output of the SQL Plus session will be in $Output.

You can parse it for next actiosn.

Hari Vetsa

On 5 Dec 2002 07:47:27 -0800, P Verstege <northfinchley_at_hotmail.com> wrote:

> 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.
>

-- 
Speakeasy
Received on Thu Dec 05 2002 - 21:53:41 CET

Original text of this message