View Single Post

   
  #3 (permalink)  
Old 02-22-2008, 04:57 PM
Guy
 
Posts: n/a
Default Re: WHENEVER SQLERROR does'nt always work

Rauf Sarwar <rs_arwar@hotmail.com> wrote in message news:<3049406.1056688632@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
Reply With Quote