How to trap error in sqlplus?

From: Prasad Mahale <pmahale_at_yahoo.com>
Date: 11 Jun 2003 14:09:14 -0700
Message-ID: <44a6df49.0306111309.7c80316a_at_posting.google.com>


Hi All,
I am not an expert in oracle but trying to do something like this -

Here are the lines from the shell script -

..
..

$ORACLE_HOME/bin/sqlplus -S $O_USER/$O_PASSWORD << EOF set serveroutput on
set echo off
set feedback off
set heading off
spool $SPOOLFILE
EXECUTE procedure01;
EXECUTE procedure02;
spool off
exit
EOF

..
..

What happens is, when procedure01 fails, it goes ahead and executes procedure02. I want Oracle to exit if procedure01 fails. What is the easiest way to do this?

Thanks in advance.

prasad Received on Wed Jun 11 2003 - 23:09:14 CEST

Original text of this message