Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Strange contraint help please...

Re: Strange contraint help please...

From: Brian Dick <bdick_at_home.com>
Date: Thu, 29 Nov 2001 14:16:22 GMT
Message-ID: <WqrN7.20818$Xb7.163799@news1.wwck1.ri.home.com>


Declarative referential integrity only allows one referenced table. You have to use a trigger to enforce your constraint.

"harry" <a_at_abc.com> wrote in message
news:vo2c0uooh12rrv7bsfssqk1coshe0om60r_at_4ax.com...
> Using Oracle 8i on win NT 4 server(sp6a)
>
> How can I get around this problem? - I have 3 tables with one column
each -
>
> A
> =
> ID number(8)
>
> B
> =
> ID number(8)
>
> C
> =
> ID number(8)
>
>
> containin data
>
> A
> =
> 1
> 2
> 3
>
> C
> =
> 4
> 5
> 6
>
> B
> =
> 1
> 2
> 3
> 4
> 5
> 6
>
> how can I add a referential integrity constraints to table B that ensures
the values exist in tables
> A OR C ?
>
> This code below fails as 4,5,6 are in table B -
>
> ALTER TABLE b ADD CONSTRAINT A_FK
> FOREIGN KEY (ID)
> REFERENCES a (ID) ;
>
>
> Any ideas?
>
> thanks
>
> harry
Received on Thu Nov 29 2001 - 08:16:22 CST

Original text of this message

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