Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Supress Display of Oracle Error Messages in SQL*PLus

Re: Supress Display of Oracle Error Messages in SQL*PLus

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Fri, 17 May 2002 15:49:13 +0100
Message-ID: <3ce5186a$0$231$ed9e5944@reading.news.pipex.net>


if you do it that way then you can be sure of capturing errors.

--
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

******************************************
"Peter Laursen" <ptl_at_edbgruppen.dk> wrote in message
news:3ce4da4f$0$18624$edfadb0f_at_dspool01.news.tele.dk...

>
> "Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> wrote in message
> news:3ce4ce62$0$8514$ed9e5944_at_reading.news.pipex.net...
> > if you are using a prewritten script use set termout off at the start of
> the
> > command you wish to blank and set termout on for the command you wish to
> > see. This doesn't work when issued interactively which was what I
thought
> > you were after.
> >
> > eg
> >
> > set termout off
> > drop table niall_test;
> > create table niall_test;
> > drop table niall_test;
> > set termout on
> > drop table niall_test;
> > create table niall_test;
> > drop table niall_test;
> >
> Thanks Neil,
>
> Didnt know you could do that
> I usually do like this:
> SQL> drop table x;
> drop table x
> *
> ERROR at line 1:
> ORA-00942: table or view does not exist
>
> SQL> create or replace procedure runx(stmt varchar2) is
> 2 cid integer;
> 3 tabel_or_view_does_not_exsist exception;
> 4 pragma exception_init(tabel_or_view_does_not_exsist, -942);
> 5 begin
> 6 cid := DBMS_SQL.OPEN_CURSOR;
> 7 DBMS_SQL.PARSE(cid, stmt, DBMS_SQL.Native);
> 8 DBMS_SQL.CLOSE_CURSOR(cid);
> 9 exception
> 10 when tabel_or_view_does_not_exsist then
> 11 DBMS_SQL.CLOSE_CURSOR(cid);
> 12 when others then
> 13 DBMS_SQL.CLOSE_CURSOR(cid);
> 14 raise;
> 15
> 16 end;
> 17 /
>
> Procedure created.
>
> SQL> exec runx('drop table x');
>
> PL/SQL procedure successfully completed.
>
>
> Peter Laursen
>
>
Received on Fri May 17 2002 - 09:49:13 CDT

Original text of this message

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