Grrr! How do you make sqlplus exit on a syntax error!

From: Peter Lacey <placey_at_wanderingbarque.com>
Date: 8 Oct 2002 13:58:09 -0700
Message-ID: <b9da3c48.0210081258.11e3661e_at_posting.google.com>



[Quoted] [Quoted] I want to call various sql scripts from within a perl script and know if they succeeded or failed. After a series of setbacks I have the following code preceeding the SQL itself:

WHENEVER OSERROR EXIT 255
WHENEVER SQLERROR EXIT 255
CONNECT &1/&2_at_&3
BEGIN
  NULL;
END;
/
WHENEVER SQLERROR EXIT SQL.SQLCODE The 6 silly lines in the middle were needed simply to get sqlplus to exit on a failed login. However, if the SQL that follows contains a -syntax- error, nothing happens, sqlplus just keeps running the SQL. So the question is, where is the Oracle equivalent of WHENEVER SYNTAXERROR EXIT (whatever). Be aware that there are tens of files each thousands of lines long. A good answer would allow me to modify each file in just one place.

[Quoted] <rant>Who wrote this thing, anyway? Hasn't sqlplus been around for 100 years? Hasn't anyone ever needed to simply exit sqlplus when something -anything- goes wrong?</rant> Received on Tue Oct 08 2002 - 22:58:09 CEST

Original text of this message