Home » SQL & PL/SQL » SQL & PL/SQL » Two foreign keys for one column
Two foreign keys for one column [message #222108] Thu, 01 March 2007 19:45 Go to next message
Messages: 202
Registered: April 2006
Senior Member
Can two foreign keys be added to one column .If so what drawbacks can I face ?

I have tbles namely
view -{columns} : view_id, name
view_forms -{columns} : view_id(FK1),form_id(FK2,FK3)
form_builder_form -{columns} : form_id
custom_form -{columns} : form_id

View can have a property called forms and it can be multiple forms.

forms are of two types one is formbuilder_form and one is custom-form

So the form associated with view can be either a form from form_builder_from or custom_form

So can I have multiple FK on the column form_id in table view_forms?

Re: Two foreign keys for one column [message #222139 is a reply to message #222108] Fri, 02 March 2007 00:28 Go to previous message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
You can have multiple foreign key constraints on a single column, but it means both parent tables must contain every key value. It is not possible to enforce a foreign key whereby the key must exist in one of many parents.

Ross Leishman
Previous Topic: ratio
Next Topic: sql lob data type
Goto Forum:

Current Time: Wed Jul 26 14:09:19 CDT 2017

Total time taken to generate the page: 0.23434 seconds