Re: So what's null then if it's not nothing?

From: David Cressey <david.cressey_at_earthlink.net>
Date: Sat, 03 Dec 2005 11:40:37 GMT
Message-ID: <Vufkf.8470$N45.6648_at_newsread1.news.atl.earthlink.net>


"Jon Heggland" <heggland_at_idi.ntnu.no> wrote in message news:MPG.1dfb84d349387263989724_at_news.ntnu.no...

> I also want NOT NULL to be default; it makes a difference. In D4 syntax
> (where NULL, or "nil" as Dataphor calls is, is disallowed by default):
> 1. Age : Integer { nil }
> 2. Age : Integer
> 3. Age : Integer { nil,
> constraint PossiblyOldEnough IsNil(value) or value >= 16 }
> 4. Age : Integer { constraint DefinitelyOldEnough value >= 16 }

I agree. If I were redesigning SQL from the ground up, and with the benefit of hindsight, I would take this route.

Possibly with two column qualifiers, the reserved words KEY and OPTIONAL.

The reserved word OPTIONAL, means that NULLS are allowed in the column.

The reserved word KEY means that this column is (one of) the column(s) that will be used to reference rows in the table.

Obviously, you can't declare a column to be both OPTIONAL and KEY.

People want to throw NULLS all over the place? Make 'em type a little more at CREATE time!

I'm still not happy with the above construct, but I prefer it to present SQL. Received on Sat Dec 03 2005 - 12:40:37 CET

Original text of this message