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: modeling / null-values in composite pk?

Re: modeling / null-values in composite pk?

From: Bob Bain <bob.bain_at_terra-nova.e-mail.com>
Date: Fri, 21 Jan 2000 14:29:45 -0000
Message-ID: <v4_h4.96$7R.1086@news.colt.net>


Don't use a primary key, instead create a unique index on the three columns, same as a primary key but allows NULL values (see post What is Difference between Primary Key and Unique Index)

HTH Bob

Jan-Erik Rosinowski <spamfilter_at_rosinowski.de> wrote in message news:38894359.12701233_at_News.CIS.DFN.DE...
>
> we've got a table with 4 attributes:
>
> create table lookup (
> key varchar2(50) not null
> value varchar2(50) not null
> implieskey varchar2(50) null
> impliesvalue varchar2(50) null);
>
> which is used to model lookuplists (key,value) and - if appropriate,
> used to enforce the setting of other fields (implieskey,impliesvalue).
>
> primary key is (key,value) but it would make sense to include the
> "implieskey" attribute to allow multiple implications of a single
> lookup-value. how can we handle this? implieskey must be nullable or
> reference another table (fk). we use ora 7.3.4
>
> any ideas?
>
> splitting the table into two tables (key,value) and
> (key,value,impliedkey not null,impliedvalue) with the latter using the
> pk as desired above seems to be logically correct but somewhat
> braindead
>
> any help greatly appreciated
>
> ciao, jan
>
> http://www.rsp.de - Software zur effizienten Erstellung und Verwaltung von
> Gutachten, Analysen, Pruefprotokollen etc.
Received on Fri Jan 21 2000 - 08:29:45 CST

Original text of this message

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