Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Conditionally quitting Sqlplus

Re: Conditionally quitting Sqlplus

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 16 Apr 2007 07:00:22 -0700
Message-ID: <1176732022.322041.136650@n76g2000hsh.googlegroups.com>


On Apr 16, 8:44 am, "Transalp" <nick_william..._at_mentor.com> wrote:
> Hi all,
>
> Is is possible to do this in 9i and 10g?
>
> I have an upgrade script that does some pre-upgrade checking before
> applying schema changes, and I want it to quit before applying the
> schema changes if it finds certain problems in the data. I'm just
> looking for something like an IF-THEN-QUIT that would work in the
> context of an anonymous PL/SQL block.
>
> TIA
> Transalp

In pl/sql code use raise_application_error (see PL/SQL Users Guide and Reference) to terminate the pl/sql code and return to SQLPlus.

In SQLPlus use the WHENEVER clause to exit on error:whenever sqlerror exit FAILURE. See the SQLPlus manual.

HTH -- Mark D Powell -- Received on Mon Apr 16 2007 - 09:00:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US