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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help: Cross-Referenced Foreign Keys

Re: Help: Cross-Referenced Foreign Keys

From: Chuck Price <c_price_at_interaccess.com>
Date: Mon, 14 Dec 1998 14:31:25 GMT
Message-ID: <367520bc.71759063@news.interaccess.com>


On 13 Dec 1998 23:02:11 GMT, markp28665_at_aol.com (MarkP28665) wrote:

>Chuck is having trouble trying to create two tables each of which has a foreign
>key, FK, reference to the other. Your problem is that you are trying to create
>a FK reference to a non-existent table so create the tables first and then use
>the alter table statement to add the FK's.
>
>Please check the SQL manual for the syntax but it is something like:
>alter table table_1
> add constraint foreign_key_name
> references talbe_2(col1,col2,...N) ;

Thanks. I had tried this previously -- and again to be sure, but this is an invaild alter table option. The "Complete Reference" offers no example for adding a FK constraint -- only check constraints.

I suppose an update trigger could be added in place of one of the FK restraints, but that doesn't seem like the most elegant solution. Received on Mon Dec 14 1998 - 08:31:25 CST

Original text of this message

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