2 Foreign Keys on 1 column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sunilkroy
    New Member
    • Dec 2006
    • 1

    2 Foreign Keys on 1 column

    Oracle allows us to create 2 Foreign Key constraints on 1 column.
    But If I insert a record that satisfies one Foreign Key constraint, then the other Foreign Key constraint complains.

    Is there a way we can use both the constraints & insert records that satisfies only one constraint at a time?

    Looking for an expert opinion.

    Thanks in advance.
  • suvam
    New Member
    • Nov 2006
    • 31

    #2
    See, if 2 foreign keys exist on 1 column(say the scenario is ,T1 is master,T2 and T3 are having foreign key) , then No referencial integrity constraints would be violated for the other one .
    Because , if u insert child record in T2 and T1 is already having that record , then one condition is fulfilled . But the record inserted in T2 is in no way related to T3 .So T1 may have that record , but T3 may not have . So no constraint violation .
    Please check .

    Comment

    Working...