Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help: Cross-Referenced Foreign Keys
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
![]() |
![]() |