Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: modeling / null-values in composite pk?
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
![]() |
![]() |