Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Foreign key constraints

Re: Foreign key constraints

From: Michael Serbanescu <mserban_at_postoffice.worldnet.att.net>
Date: 1997/08/05
Message-ID: <33E6BAFE.6CE5@postoffice.worldnet.att.net>#1/1

Try this:

SELECT table_name, constraint_name, column_name FROM user_cons_columns
WHERE constraint_name IN
(SELECT constraint_name
 FROM user_constraints
 WHERE constraint_type = 'R'
 AND r_constraint_name IN
 (SELECT constraint_name
  FROM user_constraints
  WHERE constraint_type IN ('P','U')
  AND table_name='<your_parent_table_name>'  )
)
ORDER BY table_name, constraint_name, position;

Hopte this helps.

Michael Serbanescu



Brian Gastineau wrote:
>
> Is there a way to find all the foreign keys pointing to a particular parent
> table? USER_CONSTRAINTS provides the list the other way around (child
> tables).
>
> Thanks,
> Brian
> bgastine_at_giveblood.org
Received on Tue Aug 05 1997 - 00:00:00 CDT

Original text of this message

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