From: dcure@ifremer.fr (David CURE)
Subject: Re: How can I reconstruct foreign key constraints from data dictionary tables?
Date: 1995/05/05
Message-ID: <1995May5.121802.6118@molene.ifremer.fr>#1/1
sender: news@molene.ifremer.fr
references: <3ocl5b$t8v@bock.freinet.de>
organization: Ifremer
reply-to: dcure@ifremer.fr
newsgroups: comp.databases.oracle


In article <3ocl5b$t8v@bock.freinet.de>, Peter Wazinski <wazinski@fid.freinet.de> writes:
>I have created a table like
>
>   create table test(
>          test_col number constraint fk_test
>                          references test2(test_col2));
>
>How can I reconstruct fk_test by examining the data dictionary
>tables, e.g. user_constraints or user_cons_columns?
>
>I have only been able to find out that test_col points to a column
>in table test2 but I couldn't figure out the name of the column?

	desc user_cons_columns ->

	 Name				 Null?	  Type
 ------------------------------- -------- ----
 OWNER				 NOT NULL VARCHAR2(30)
 CONSTRAINT_NAME		 NOT NULL VARCHAR2(30)
 TABLE_NAME			 NOT NULL VARCHAR2(30)
 COLUMN_NAME 			 NOT NULL VARCHAR2(30)
 POSITION				  NUMBER

	COLUMN_NAME is the name of the column ;-)))

	David.
-- 

   _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   David Cure - Ifremer/Brest - SISMER - BP70 - 29280 PLOUZANE - FRANCE
     Email : David.Cure@ifremer.fr / Tel : 98.22.46.42 - 98.22.42.10
           WWW : http://www.ifremer.fr/sismer/sommaire.htm

   " Apres avoir vu la lumiere, on ne retourne pas dans les tenebres "




