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: View tables with no Foreign Keys?

Re: View tables with no Foreign Keys?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 12 Sep 2006 09:21:56 -0700
Message-ID: <1158078116.841594.195200@e3g2000cwe.googlegroups.com>

RJ wrote:
> Hi All,
>
> Is there a statement (any method) of getting a list of tables with no
> FK references?
>
> Thanks..

RJ, your post is not clear to me: do you want a list of tables that do not have a FK reference to another table or a list of tables that have no FK references to the table from any other table?

Both queries can be written using the DBA_CONSTRAINTS view potentially in conjuction with the DBA_TABLES view.

Here is a query to find tables WITH a FK reference to another table   1 select owner, table_name, constraint_name   2 from dba_constraints
  3 where constraint_type = 'R'
  4* and owner not in ('SYS','SYSTEM')

HTH -- Mark D Powell -- Received on Tue Sep 12 2006 - 11:21:56 CDT

Original text of this message

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