vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 -- Posted via http://dbforums.com |
| |||
| Hi! > Programming 101 says to *always* test your program/script before > deploying it or running it unattended. This would atleast catch your > syntax errors. It actually doesn't require a book for understanding that. One more issue (from my experience) with scripting is that always test the *whole* script after modifying some contents of it. Even if the change seems to be trivial, there's always (or very often) something that's overlooked and causes errors. Tanel. |
| |||
| 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 |
| |||
| "Tanel Poder" <tanel@@peldik.com> wrote in message news:<3efc00d2$1_1@news.estpak.ee>... > Hi! > > > Programming 101 says to *always* test your program/script before > > deploying it or running it unattended. This would atleast catch your > > syntax errors. > > It actually doesn't require a book for understanding that. One more issue > (from my experience) with scripting is that always test the *whole* script > after modifying some contents of it. Even if the change seems to be trivial, > there's always (or very often) something that's overlooked and causes > errors. > > Tanel. I was metaphorically referencing "Programming 101"... and not as some actual book :->) Regards /Rauf Sarwar |