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: conditional foreign key constraint

Re: conditional foreign key constraint

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 15 Jan 2004 13:12:18 -0000
Message-ID: <bu641d$d64$1$830fa79f@news.demon.co.uk>

Note in-line

-- 
Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

  The educated person is not the person
  who can answer the questions, but the
  person who can question the answers -- T. Schick Jr


Next public appearance2:
 March 2004 Hotsos Symposium - Keynote
 March 2004 Charlotte NC - OUG Tutorial
 April 2004 Iceland


One-day tutorials:
http://www.jlcomp.demon.co.uk/tutorial.html


Three-day seminar:
see http://www.jlcomp.demon.co.uk/seminar.html
____UK___February


The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html


"Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message
news:1074097744.811435_at_yasure...

> Cookie Monster wrote:
>
> > Hi,
> >
> > I want to create a foreign key constraint which is only checked when a
> > certain value in one of the field is set. such that I have a field
called
> > STATUS and when the value equals 1 then my foreign key is active on that
> > row. I guess this is not really possible without a trigger but a
trigger
> > would take forever as I have thousands of rows. has anyone had
something
> > similar and has an idea of how I could perhaps do this.
> >
> > Thanks in advance
> > cookie.
>
> What you have hear screams in pain that you have a design issue. There
> is no possible relational design I can imagine, and I have a reasonably
> fertile imagination, that requires such a conditional constraint.
>
Case*Method : Entity Relationship Modelling Richard Barker 1989. p. 4 - 3 - Exclusion Arcs: Each account must be against one and only one individual or against one and only one company. The OPs question sounds like one possible strategy for a physical implemention of a fairly common design requirement.
> Why don't you tell us the business problem you are trying to solve and
> let us suggest the solution rather than telling us "your" solution and
> asking us to figure out how to do it.
>
My example above does not, of course, invalidate your follow-up comment.
Received on Thu Jan 15 2004 - 07:12:18 CST

Original text of this message

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