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: Foreign key

Re: Foreign key

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Mon, 20 May 2002 14:21:36 +0100
Message-ID: <3ce8f861$0$234$ed9e5944@reading.news.pipex.net>


That isn't a relation so (AFAIK) you can't achieve it with keys. You could however achieve it with the use of triggers.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
"alex" <alienhipopotamus_at_caramail.com> wrote in message
news:1d3c465f.0205200503.4c69d345_at_posting.google.com...

> 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!
Received on Mon May 20 2002 - 08:21:36 CDT

Original text of this message

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