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: Looking for a way to implement SQL-92 Domain

Re: Looking for a way to implement SQL-92 Domain

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 24 Mar 2003 21:54:09 -0600
Message-ID: <ufzpckjs6.fsf@hotpop.com>


On Tue, 25 Mar 2003, forbrich_at_telusplanet.net wrote:
> Galen Boyer wrote:
>

>> You can't guarantee that the lookup field entered is contained within
>> the correct domain, just that it exists within the entire domain of
>> lookups.  The seperate lookup tables assure that you have the correct
>> domain as well, not just _any_ lookup value.
>>

>
> Actually, you can merge all lookup tables and keep referential
> integrity. It's ugly but workable!.

Looking at the description, I'd have to agree. :-)

> You need to add a ref_type or domain_type column, never filled, with a
> default and possibly a check constraint, that drives to the correct
> domain.

Sounds like Nuno's solution.

> The foreign key goes against the twinned 'domain' and 'value' columns.
> Works because the twinned columns are the primary key.

So then you have two columns for each lookup in the child table? Ughhh... I have some tables with many many lookups. You just doubled the number of lookup columns in that table.

I'd rather proliferate specific lookups but refer to them with a particular id in the child table. Use a naming convention on the lookup tables to help everybody either get to the one they need or exclude them all from view.

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.
Received on Mon Mar 24 2003 - 21:54:09 CST

Original text of this message

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