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: child and parent tables

RE: child and parent tables

From: Diana Duncan <Diana_at_fileFRENZY.com>
Date: Wed, 11 Oct 2000 12:40:48 -0400
Message-Id: <10646.118984@fatcity.com>


select c2.table_name
from user_constraints c1, user_constraints c2 where c1.owner = c2.r_owner

and c1.constraint_name = c2.r_constraint_name
and c1.table_name = upper('&parent_table_name')
and c1.constraint_type = 'P'

/

-----Original Message-----
From: Rahul [mailto:rahul_at_ratelindo.co.id] Sent: Wednesday, October 11, 2000 6:56 AM To: Multiple recipients of list ORACLE-L Subject: RE: child and parent tables

look for foreign key constraints in user_constraints tables if a column is referencing to another table.column then it's a CHILD table and the referred table is the MASTER...

look for r_constraint_name column, then use the constraint_name in this column to find out the table where constraint_name = .....

remember a child can have further children...

> ----------
> From: nida Khan[SMTP:nida_at_webstar.co.uk]
> Sent: Wednesday, October 11, 2000 4:37 PM
> To: oracledba_at_lazydba.com
> Subject: child and parent tables
>
> Hi every one,
>
> How can I find out name of child tables of a parent table???(urgent)
>
>
> regards
> Nida.
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rahul
  INET: rahul_at_ratelindo.co.id

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 Wed Oct 11 2000 - 11:40:48 CDT

Original text of this message

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