Re: Referential constraints
Date: Thu, 31 Aug 2000 10:24:40 -0700
Message-ID: <39AE94D8.2D22DB0C_at_solarturbines.com>
Why not just use DBA_CONSTRAINTS and DBA_CONS_COLUMNS and join R_REF_CONSTRAINT to CONSTRAINT_NAME?
OKOKOK, use SQLPlus and do:
break on child_table skip 1 on constraint_name skip 1 on parent_table
skip 1
select
c.table_name child_table,
c.constraint_name,
cc.table_name parent_table,
cc.column_name
from
dba_cons_columns cc,
dba_constraints c
where
c.r_constraint_name = cc.constraint_name
and c.owner = '(put schema here)'
order by
c.table_name,
c.constraint_name,
cc.table_name,
cc.position
/
(Hopefully you have access to these DBA views. Also, it is a pretty slow query because Oracle gets slightly retarded it you join a view to a view.)
Johan den Boer wrote:
>
> Hi,
>
> I am looking for a script which can display the referential
> constraints between tables and their columns.
> Does anyone know a good website to get such scripts ?
>
> --
> Regards
>
> Johan den Boer
> email : jj.den.boer_at_hccnet.nl
Received on Thu Aug 31 2000 - 19:24:40 CEST