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

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 14 Oct 2002 15:43:54 GMT
Message-ID: <3DAAE634.6EDF022A_at_exesolutions.com>


Niall Litchfield wrote:

> It isn't the sql thats the problem its the various sqlplus commands etc that
> aren't accepted by pl/sql. suppose you get a connect statement wrong for
> example (or the password has been changed etc). You would then want sqlplus
> to exit. I agree with Chris that it is a highly minor enhancement request,
> but it would be a 'nice' feature.
>
> --
> Niall Litchfield
> Oracle DBA
> Audit Commission UK
> *****************************************
> Please include version and platform
> and SQL where applicable
> It makes life easier and increases the
> likelihood of a good answer
>
> ******************************************
> "Daniel Morgan" <dmorgan_at_exesolutions.com> wrote in message
> news:3DA6EDCC.195EC257_at_exesolutions.com...
> > Niall Litchfield wrote:
> >
> > > "Daniel Morgan" <dmorgan_at_exesolutions.com> wrote in message
> > > news:3DA5BE71.87C125DF_at_exesolutions.com...
> > > > I'll try again.
> > > >
> > > > What's wrong with:
> > > >
> > > > BEGIN
> > > > ... your SQL statement here
> > > > ... your SQL statement here
> > > > ... your SQL statement here
> > > > END;
> > > > /
> > > >
> > > > Seems to me the functionality requested already exists. Just wrap
> BEGIN
> > > and END
> > > > around your SQL.
> > >
> > > Sqlplus scripts do not necessarily just consist of sql
> > >
> > > SQL> begin
> > > 2 set echo off
> > > 3 execute immediate 'select sysdate from dual';
> > > 4 end;
> > > 5 /
> > > set echo off
> > > *
> > > ERROR at line 2:
> > > ORA-06550: line 2, column 6:
> > > PL/SQL: ORA-00922: missing or invalid option
> > > ORA-06550: line 2, column 2:
> > > PL/SQL: SQL Statement ignored
> > >
> > > SQL>
> > > --
> > > Niall Litchfield
> > > Oracle DBA
> > > Audit Commission UK
> > > *****************************************
> > > Please include version and platform
> > > and SQL where applicable
> > > It makes life easier and increases the
> > > likelihood of a good answer
> > >
> > > ******************************************
> >
> > Try running your SQL statement at the SQL*Plus command line and let me
> know
> > how it works?
> >
> > Connected to:
> > Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
> > With the Partitioning option
> > JServer Release 8.1.7.0.0 - Production
> >
> > SQL> execute immediate 'select sysdate from dual';
> > BEGIN immediate 'select sysdate from dual'; END;
> >
> > *
> > ERROR at line 1:
> > ORA-06550: line 1, column 17:
> > PLS-00103: Encountered the symbol "select sysdate from dual" when
> expecting
> > one of the following:
> > := . ( _at_ % ;
> > The symbol ":=" was substituted for "select sysdate from dual" to
> continue.
> >
> >
> > SQL>
> >
> > Of course it isn't the solution to every problem: What is? But it sure
> works
> > with 90% of the SQL run from scripts which is mostly insert, update, and
> > delete.
> >
> > Daniel Morgan
> >

Agreed.

Daniel Morgan Received on Mon Oct 14 2002 - 17:43:54 CEST

Original text of this message