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

From: vc <boston103_at_hotmail.com>
Date: 26 Dec 2005 06:01:17 -0800
Message-ID: <1135605677.872037.17610_at_o13g2000cwo.googlegroups.com>


Jon Heggland wrote:
> In article <1135259856.681792.90350_at_g43g2000cwa.googlegroups.com>,
> boston103_at_hotmail.com says...
> >
> > > 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.
>
> No, no change. The 'exception' explanation is just sophistry in order to
> avoid redefining the operators. :)

If so, then you are using your private language in which 'exception' means something different from the usual 'terminating the normal excution flow and notifying the user about an error'. Using this kind of private language is hardly productive or interesting.

> When a null subexpression is
> encountered, exceptional processing takes over, causing the whole
> expression to be null regardless of operators (hence my "+ is
> irrelevant" comment---the operator doesn't matter because the
> exceptional processing takes over).

It does not matter whether one calls such procesing exceptional or unexceptional. What matters is the fact that 2 + NULL results in NULL.  In the math language, it's interpreted as an addition operation applied to two elements of some set and producing an element of the same set. What description/interpretation can be simpler ?

You, on the other hand, in trying to exclude NULL from a set you operate on, do not even have a proper language to describe what's going on and resort to a rather weird vocabulary like 'exceptional processing'. There are no exceptions, no execution flow interruption,  the operation accepts two input elements and produces one element, how is it different from what any mathematical operation does ? Your own words "causing the whole
 expression to be null" is just a synonym for "the expression evaluationg to null".

> I.e. expressions still "evaluate to
> NULL", though I prefer not to use that phrase: it makes NULL look like a
> value.

So what ? Mathematically, it *is* a value or an element of some set over which the addition, or some other, operation is defined.

If you want to exclude NULL from domains any operation is defined over,  you'll have to invent a new math since the math language we employ now cannot express what you trying to do with NULL. You are free of course to do so, good luck with that.

[...]
> I'm not suggesting to change how SQL works, only how it is explained.

Well, the language you employ is not adequate for for this purpose. You cannot use, or you have to redefine, words like 'operation', 'function, 'math relation' because, in your description of how NULL is handled, those words mean something different from their accepted mathematical interpretation.

[...]
>different discussion.
> --
> Jon
Received on Mon Dec 26 2005 - 15:01:17 CET

Original text of this message