Re: Referential constraints

From: Robin Quasebarth <quasebarth_robin_r_at_solarturbines.com>
Date: Thu, 31 Aug 2000 13:46:39 -0700
Message-ID: <39AEC42F.6EA6BB9B_at_solarturbines.com>


Why not just use DBA_CONSTRAINTS and DBA_CONS_COLUMNS and join R_CONSTRAINT_NAME 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 - 22:46:39 CEST

Original text of this message