Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Part of a composite primary key requires nulls

Re: Part of a composite primary key requires nulls

From: Mark Powell <Mark.Powell_at_eds.com>
Date: 16 Dec 1998 16:38:28 GMT
Message-ID: <01be2912$d6d6bce0$a12c6394@J00679271.ddc.eds.com>


Do you have to declare this collection of columns as a primary key? You could just build a unique index on the columns and then you can have one of the columns be nullable. If you need to reference this key in a foreign key reference then you have a design flaw since a primary key constraint is actually the combination of a unique constraint and the not null constraint, hence, the automatic attribute change to 'not null' by Oracle. Oracle is doing as it should.

Any time you end up with the situation that a table is inheriting a nullable column as part of its primary key you have a design issue. I would not call it a bug since the real world does not always follow relational design rules. You may be able to substitute a surrogate (generated) key for the row of the parent table that supplies the nullable column.

Stephanie Y <stephy_at_choicebuilder.com> wrote in article <3676c1aa.0_at_news.nwlink.com>...
> When I change ONE of three attributes that make up a primary key in a
table
> to NULL, Oracle 8 automatically changes this attribute back to NOT NULL.
Is
> there a way to do this? I would greatly appreciate it!
>
> --Stephanie
>
>
>
Received on Wed Dec 16 1998 - 10:38:28 CST

Original text of this message

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