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: Constraint

Re: Constraint

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 24 Mar 2005 11:55:26 -0800
Message-ID: <42431b2e@news.victoria.tc.ca>


mike (hillmw_at_charter.net) wrote:
: Trying to make a constraint

: Instead of a constraint like this:

: ALTER TABLE table_A
: ADD CONSTRAINT XFK_table_A_ID FOREIGN KEY (table_A_ID)
: REFERENCES table_B(table_B_ID)

: I'd like to do something like:

: ALTER TABLE table_A
: ADD CONSTRAINT XFK_table_A_ID FOREIGN KEY (table_A_ID)
: REFERENCES
: table_B, table_C where table_B.id=table_C.id and table_C.level='0'

: Does that make any sence?

Sort of, though I've never tried to do anything like that using a simple constraint definition

_however_

you can certainly write a trigger to enforce this.

--

This space not for rent.
Received on Thu Mar 24 2005 - 13:55:26 CST

Original text of this message

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