Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to retrieve relationship and FKs?
dba_constraints gives you the primary and foreign keys of all the tables.
v734> desc dba_constraints
Name Null? Type ------------------------------- -------- ---- OWNER NOT NULL VARCHAR2(30) CONSTRAINT_NAME NOT NULL VARCHAR2(30) CONSTRAINT_TYPE VARCHAR2(1) TABLE_NAME NOT NULL VARCHAR2(30) SEARCH_CONDITION LONG R_OWNER VARCHAR2(30) R_CONSTRAINT_NAME VARCHAR2(30) DELETE_RULE VARCHAR2(9) STATUS VARCHAR2(8)
constraint_type is 'P' for a primary key and 'R' for a foreign key. For the latter r_constraint_name gives you the primary key referenced.
-- Have a nice day Michel "Bernd Maierhofer" <Bernd.Maierhofer_at_dato.at> a écrit dans le message news: sOdi6.107217$1C6.3763701_at_news.chello.at...Received on Tue Feb 13 2001 - 11:09:30 CST
> Hi and thanks in advance!
>
> Given Table A, how do I retrieve the dependent tables along with the
> relationship and the foreign keys?
> On the other hand, how do I retrieve the parent tables along with the
> relations?
>
> --
>
> Bernd Maierhofer
>
> dato Denkwerkzeuge
> Bernd.Maierhofer_at_dato.at
>
> Please: No private mail unless explicitly invited.
>
>