Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to get the list of tables used in a view?

RE: How to get the list of tables used in a view?

From: Reardon, Bruce (CALBBAY) <Bruce.Reardon_at_comalco.riotinto.com.au>
Date: Thu, 12 Jul 2001 20:20:38 -0700
Message-ID: <F001.003496DB.20010712201543@fatcity.com>

Hi Ashoke,

Under 817 you can use dba_dependencies - their may be other ways as well.

For example:

SQL> create table a (a integer);

Table created.

SQL> create table b (b integer);

Table created.

SQL> create view ab as select * from a,b where a=b;

View created.

SQL> select * from dba_dependencies where NAME = 'AB';

OWNER NAME TYPE REFERENCED_OWNER REFERENCED_NAME REFERENCED_T REFERENCED_LINK DEPE

---------- ---------- ---- ------------------------------ ---------------
------------ --------------- ----
USER000001 AB         VIEW USER000001                     B
TABLE                        HARD
USER000001 AB         VIEW USER000001                     A
TABLE                        HARD

2 rows selected.

Searching dba_views.text will be a problem if the table names are split over more than 1 line in the view definition.

Regards,
Bruce Reardon

-----Original Message-----
Sent: Friday, 13 July 2001 1:10

Greetings,

Is there any dictionary table/view where I can query the name of all the tables used by a particular view?

The way I do now is : Query the line containing 'from' in text field of dba_views for the specified view.

Is there any other way to get the list of the tables used by a view?

Thanks,
Ashoke
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Reardon, Bruce (CALBBAY)
  INET: Bruce.Reardon_at_comalco.riotinto.com.au

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Jul 12 2001 - 22:20:38 CDT

Original text of this message

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