Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Part of a composite primary key requires nulls
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
![]() |
![]() |