Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Testing a table existence
Niall Litchfield <n-litchfield_at_audit-commission.gov.uk> wrote:
>However you need dba privs to query this view and would want to specify the
>owner of the table.
To be pedantic, you need select_catalog_role privilege, not full DBA.
>"Peter Lintner" <peter.lintner_at_sos-kd.org> wrote in message
>news:IP4R7.28$zy5.898_at_psinet-eu-nl...
>> Hi Sylvain!
>> Following works:
>> myVariable:=0;
>> select count(*) into myVariable from dba_tables where
>table_name='MYTABLE';
>> if myVariable>0 then
>> ...
>> end if;
>>
>> I prefer dba_tables, because so the table owner can be any user!
-- Andrew Mobbs - http://www.chiark.greenend.org.uk/~andrewm/Received on Tue Dec 11 2001 - 08:18:24 CST