Re: How to return a status from sqlplus to .ksh unix script ?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 12 Aug 2004 08:11:30 -0700
Message-ID: <2687bb95.0408120711.2b3dfb88_at_posting.google.com>


zglickman_at_il.bphx.com (Zvika Glickman) wrote in message news:<b6b91e64.0408112255.3e8e7b82_at_posting.google.com>...
> I have a script a.ksh as follow:
>
> [vashti]<orasp> cat a.ksh
> sqlplus -s rsi/rsi < aaa1.sql
> echo stat $?
> [vashti]<orasp>
>
> text of aaa1.sql:
>
> exec dbms_stats.gather_table_stats
> ('P0E1A00','MI_AC_CIRBE_GEN',cascade=>true,estimate_percent=>25);
>
> Problem: how can i transfer the status of the execution of
> dbms_stats.gather_table_stats to the .ksh ????

Z, look up the SQLPlus command "whenever sqlerror exit FAILURE"

Many times all you need to pass back to the shell is success or failure. For the exact problem you can look at the spool file.

In the case of a dmbs_stats I would generally not expect a failure message.

HTH -- Mark D Powell -- Received on Thu Aug 12 2004 - 17:11:30 CEST

Original text of this message