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: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Fri, 05 Dec 2003 00:29:01 +0100
Message-ID: <cigvsvkmb44gl0l6shs5js2b0l6ml0fqti@4ax.com>


On Thu, 4 Dec 2003 22:14:29 -0000, "Keith Jamieson" <keith_jamieson_at_hotmail.com> wrote:

>Personally, I would query the data dictionary, and I believe all_tables will
>have a list of all tables that you have access to. Alternatively, you can
>declare a table with Definer Rights (Ie The code is executed as the owner of
>the procedure, as opposed to the user who is running the procedure).
>
>The Data Dictionary is supposed to be optimised for quick access, so I would
>personally favour this approach.

Tables don't disappear on the fly, unless you have a very whacky environment. Checking for existence should be redundant and been dealt with by exception handling. Misusing the datadictionary over and over again, to check something what doesn't need to be checked will have a noticeable impact on your application as the dictionary cache will grow and trim your shared pool. Your shared pool however will grow because you are using dynamic sql everywhere. Your application will be unscalable. Now would you really like the end-user to experience how an unscalable application works? Need I say more?

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Dec 04 2003 - 17:29:01 CST

Original text of this message

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