Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Table Existence
Louis Frolio wrote:
>
> Is there a sql command in Oracle that will tell me whether or
> not a table exists? In T-SQL the command "IF EXISTS(..)" does
> just this. Any help would be appreciated.
>
> L
The easiest way is to simply check the data dictionary. For example..
declare
cnt number;
begin
select count(*) into cnt from user_tables -- or all_tables
where table_name = 'WHATEVER_TABLE';
if cnt = 0 then
FYI,
Skip Cope
Principal Consultant
__ _ _ __ __
(__)|-< /-\(__ |__(-_
Pager #800-664-3606
Quote of the day -
"I have never let my schooling interfere with my education."
Mark Twain
Received on Sun Mar 05 2000 - 15:37:49 CST