Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: View tables with no Foreign Keys?
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
![]() |
![]() |