Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Supress Display of Oracle Error Messages in SQL*PLus
"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;
Procedure created.
SQL> exec runx('drop table x');
PL/SQL procedure successfully completed.
Peter Laursen Received on Fri May 17 2002 - 05:25:14 CDT