By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,584 Members | 1,774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,584 IT Pros & Developers. It's quick & easy.

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

P: n/a
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,estimat e_percent=>25);

Problem: how can i transfer the status of the execution of
dbms_stats.gather_table_stats to the .ksh ????
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
zg*******@il.bphx.com (Zvika Glickman) wrote in message news:<b6**************************@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,estimat e_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 --
Jul 19 '05 #2

P: n/a
zg*******@il.bphx.com (Zvika Glickman) wrote in message news:<b6**************************@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,estimat e_percent=>25);

Problem: how can i transfer the status of the execution of
dbms_stats.gather_table_stats to the .ksh ????


Thanks mark,
I used:
whenever sqlerror exit sql.sqlcode;
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.