I have a sqlplus script that I'm invoking from Perl.
-- IF SQLPLUS FAILS, RETURN BAD EXITCODE
WHENEVER sqlerror EXIT sql.sqlcode
WHENEVER oserror EXIT failure
SET TIMING ON
<sql statement>
/
<sql statement>
/
.
.
.
/
COMMIT
/
EXIT
Is there a parameter/setting I can put up top to ensure that if it hits a DB error of any kind, the entire thing rolls back?
Currently if it hits an error on one of the later statements, the first ones are still being committed, and I'm in a situation where I have no control over the sqlplus default settings.
Thanks.
2005-10-21 Retitled by Arunbear, as per Monastery guidelines
Original title: 'sqlplus rollback on error'