Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Commit question in SQL*PLUS
sg <s4v4g3_at_europe.com> wrote in message news:<3D5C32F8.7010101_at_europe.com>...
> in sqlplus you can do
>
> whenever sqlerror exit 1
Use
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback
If you put these 2 commands in the beginning of your sqlplus script, any error causes script to abort, roll back all changes and finish sqlplus with return code 1. sqlerror refers to all cases of problems in sql statements, like table not found etc. oserror refers to cases like file not found, not enough diskspace etc.
>
> it exists everything when encounters an sql error
>
> abc_at_iom.com wrote:
>
> > New to Oracle, here.
> >
> > If I enter a batch of commands in SQL*PLUS, I want to have them all
> > execute if the script is ok, or NONE executed if there's an error.
> > Right now it looks like only the non-error lines of the script get
> > executed. I'm looking for All-or-none.
> >
> > Thanks.
> >
> >
Received on Fri Aug 16 2002 - 12:38:59 CDT