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: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sun, 29 Jun 2003 13:06:27 +0200
Message-ID: <vftjp4otj1m405@corp.supernews.com>

"Guy" <ni4ni_at_hotmail.com> wrote in message news:d2eb532b.0306282357.45caea09_at_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

Then either beat your programmers or have them replaced. Why are you making up for their lack of preciseness and their laziness? Will they ever learn, doing so?

Just ask them to do their job properly or send them to a SQL training, but don't tell us you can't request them to double check their scripts.

-- 
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Sun Jun 29 2003 - 06:06:27 CDT

Original text of this message

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