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

Home -> Community -> Usenet -> c.d.o.tools -> Re: NOT NULL restriction and CHECK constraint on same column in 7.3.4

Re: NOT NULL restriction and CHECK constraint on same column in 7.3.4

From: Matt Foster <matt_foster_uk_at_yahoo.co.uk>
Date: 2000/06/06
Message-ID: <393CB6FA.628A6A1A@yahoo.co.uk>#1/1

Ken Ho wrote:
>
> I seem to have discovered that the not null constraint is still
> required, since if I try to enter a legal value for ID but null for
> CODE, Oracle allows that, which is not my design intent. If someone
> else has added perspective on that, I look forward to reading it.
 

> >
> >Is there any functional or design reason to keep the CODE not null
> >restriction? The CHECK constraint prevents CODE from being null. The
> >format of the CODE data may change in the future, but if so, the CHECK
> >constraint on CODE would be updated to continue preventing CODE from
> >being null.

As you have found out, the CHECK constraint ignores NULL values so you also have to have a NOT NULL constraint.

hth,

MF Received on Tue Jun 06 2000 - 00:00:00 CDT

Original text of this message

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