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: PLSQL: how to test if a table exists?

Re: PLSQL: how to test if a table exists?

From: Ubiquitous <weberm_at_polaris.net>
Date: Fri, 24 Jun 2005 08:57:27 -0400
Message-ID: <A5idnZ12QP6lniHfRVn-jw@giganews.com>


In article <bqmunc$9nq$1_at_fata.cs.interbusiness.it>, nobody_at_nowhere.com wrote:

>in a PLSQL script, I want to execute code only if a certain table exists.
>A pseudo-solution could be:
>
>declare
> cursor c1 is select * from notable;
>begin
> open c1;
> if c1%ISOPEN then
> -- statements to execute if table exists
> end if;
>end;
>
>Obviously, the above code is not correct, first of all the script throws an
>execption if "notable" doesn't exist.
>Any workaround?

What's wrong with it raising an exception? Just add some exception handling to end gracefully. Received on Fri Jun 24 2005 - 07:57:27 CDT

Original text of this message

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