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

From: vc <>
Date: 22 Dec 2005 05:57:36 -0800
Message-ID: <>

Jon Heggland wrote:
> In article <>,
> says...
> >
> > "In any case, I'm not interested in defending how SQL NULLs work" is a
> > non sequitur. I did not ask whether or not you were interested in
> > "defending how SQL NULLs work" but rather what '+' means in *your*,
> > not SQL'92's, suggestion to evaluate 2 + X to NULL if X happens to be
> > NULL:
> You have misunderstood me, then. I'm not proposing another way of
> handling NULLs, just better language design and better(?) explanations.
> '+' means perfectly normal addition, but if any term is null, an
> exception is thrown,

Ok, fine, let's assume that if any term in an expression is null, an exception is thrown. This kind of behaviour woud practically eliminate any use of NULLs, except as placeholders, as well as the need to have a 3VL since any expression with NULLs would just thow an exception rather than evaluating to NULL or UNKNOWN. This kind of behaviour would also force the programmer to qualify any expression with the IS_NULL predicate ( the sole exception to the weird 'uniformity'/'propagation' rule you and Hugo seem to be insisting on) in order to ensure that the query would not just die. Additionally, the expression optimizer has to be crippled in a way that would guarantee that the IS_NULL predicate is evaluated first.

The question is, why bother ? All that can be achieved today on any SQL database by using the 'NOT NULL' predicate or not using NULLs altogether.

> --
> Jon
Received on Thu Dec 22 2005 - 14:57:36 CET

Original text of this message