Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Foreign key
Hi,
just some thoughts. Please don't feel toestepped.
Possibly you have to rethink your datamodel. Cases where I have seen such design, were when the designer had little understanding of supertype/subtype-relationship. Can you express your model in sentences like this?
Every T2 is a T1
Every T3 is a T1
Every T1 is either a T2 or a T3
On 20 May 2002 06:03:13 -0700, alienhipopotamus_at_caramail.com (alex) wrote:
>Hi,
>Can someone help me?
>I would like to know if it is possible to create a foreign key which
>reference two columns from different tables.
>For example, I will have three tables (T1, T2, T3).
>T1 will have a column named C1.
>T2 will have a column named C2 and T3 will have a column named C3.
>Can C1 refer to C2 and C3, such as that if I insert a line in T1, the
>Database will look for the value of C1 in C2 and C3. If the value
>inserted in C1 exists in C2 OR (not AND but OR) in C3, the insert
>statement will be accept.
>Can someone give me the statement to create that kind of relation?
>Thanks in advance for help.
>
>PS: forgive me for my english, I am not used to post english message!
regards
Marc Blum
mailto:marc_at_marcblum.de
http://www.marcblum.de
Received on Mon May 20 2002 - 10:03:39 CDT
![]() |
![]() |