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

Home -> Community -> Usenet -> c.d.o.server -> Re: WHENEVER SQLERROR does'nt always work

Re: WHENEVER SQLERROR does'nt always work

From: Guy <ni4ni_at_hotmail.com>
Date: 29 Jun 2003 00:57:18 -0700
Message-ID: <d2eb532b.0306282357.45caea09@posting.google.com>


Rauf Sarwar <rs_arwar_at_hotmail.com> wrote in message news:<3049406.1056688632_at_dbforums.com>...
> Originally posted by Guy
> > Hi
> >
> > I have a set of sql scripts that creates several tables and them
> > populates them with rows (via insert statements).
> > Each script begins with WHENEVER SQLERROR... and WHENEVER OSERROR...
> > So it should halt once an error occures. I thought this will cover all
> > possible errors.
> > The problem is that it doesnt work with all kinds of errors. For
> > example, if I wrote "nsert into" instead of "insert into" then
> > SQL*PLUS throws this error message: SP2-0734: unknown command
> > beginning "NSERT INTO..." but execution doesnt stop.
> >
> > Does it mean that WHENEVER SQLERROR doesnt catch "SP2" errors ? is
> > there a way to catch this kind of errors ? I could'nt find a clue in
> > SQL*PLUS documentation.
> >
> >
> > T.I.A
> >
> > Guy
>
>
> I think you should use tools like VisualSlick to create your scripts. It
> does syntax highlighting and indenting.
>
> Programming 101 says to *always* test your program/script before
> deploying it or running it unattended. This would atleast catch your
> syntax errors.
>
> Regards
> /Rauf Sarwar

Ok folks,

The problem is that I have about 8 programmers that writes Java code. Sometimes they also need database changes, so they have a set of scripts that they update manually as necessary. They arent pure SQL people so they make relatively many mistakes. I wrote a procedure that verify those scripts and check them for errors. What it does is a running the scripts under a temporary schema.

So "double check your script" is not really applicable here.

Guy Received on Sun Jun 29 2003 - 02:57:18 CDT

Original text of this message

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