Re: How to ensure only one of two sets of optional information?
Date: Fri, 19 Dec 2003 17:55:28 -0500
"Marshall Spight" <mspight_at_dnai.com> wrote in message
> "Bob Badour" <bbadour_at_golden.net> wrote in message
> > > I could do it with a database constraint. Is there a structural
> > > way to do it that I'm not seeing? If I have to use a constraint,
> > > is there a canonical form for this particular example? It seems
> > > like a common thing to want to do, but I haven't come across
> > > how to address the subtype-data-exclusion issue anywhere.
> > Make account type part of the account candidate key and include a
> > attribute in the referencing relations.
> OMG that is *such* a cool solution! Thanks!
> Does SQL have the concept of a "constant attribute?" Coincidentally
> I've actually been thinking lately that such a thing would be useful.
> Generically speaking it's just a type constraint and probably not
> anything all that special.
SQL has little support for anything really useful, but I think a constant value should be a relatively simple check constraint. What are the chances that any dbms out there has sufficient physical independence to avoid storing the constant for every row? Received on Fri Dec 19 2003 - 23:55:28 CET