Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to find out if a table already exists with PL/SQL
Hi TIA,
If you are going to use SQL*Plus with script file, make script file like following dorptmp.sql and execute this script file like this:
SQL>@droptmp
Mitsunori Ishikawa
spool dropping.sql
select 'PROMPT Dropping table '||table_name||'.....'||CHR(10)||'DROP TABLE '||table_name||';'
from user_tables where table_name = 'TEMPTBL';
spool off
set feedback on
set termout on
@dropping
NoSpam wrote:
>
> Hi,
>
> I'm porting a Sybase script to Oracle. There is this thing that we do in
> Sybase but I just can't do in Oracle. In Sybase, we do:
>
> if exists (select * from sysobjects where name = 'TEMPTBL')
> begin
> print "Deleting table TEMPTBL....."
> drop table TEMPTBL
> end
> go
>
> Just how do I do this in Oracle?
>
> TIA
Received on Fri Nov 10 2000 - 02:56:20 CST
![]() |
![]() |