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

From: Frank Hamersley <terabitemightbe_at_bigpond.com>
Date: Mon, 28 Nov 2005 04:58:08 GMT
Message-ID: <A7wif.5513$ea6.729_at_news-server.bigpond.net.au>


vc wrote:
> David Cressey wrote:
> [..]
>

>>As I comented  a couple of weeks ago,
>>
>>A || EMPTY == EMPTY || A == A  for every string A
>>
>>That makes EMPTY a pretty interesting string,  from my point of view.  I
>>wouldn't want to confuse it with NULL any more than I'd want to confuse the
>>integer zero with NULL.
>>
>> My comment drew no response.  I'm not about to draw any inferences from
>>that absence of a response.

>
> I had not noticed your comment before I said, later, roughly the same
> with respect to the empty string vs. NULL:
>
> "This empty string discussion is a bit strange to put it mildly. If one
> remebers what a string is (a list of characters), then an empty string
> is just an empty list, a perfectly legitimate value that one can use
> in a very much the same fashion as the integer zero."

It has always escaped me why Sybase particularly (and perhaps others) convert '' to ' ' for varchar attributes. I must admit I haven't applied much brain power to rationalising the impact on the query engine of unwinding this behaviour, but on first impression can't understand why NULL, '' and ' ' are not distinguishable. Curiously RTRIM('') gives NULL as a result!

Anyway, thats the way it is. Perhaps someone can turn on the light?

Cheers, Frank. Received on Mon Nov 28 2005 - 05:58:08 CET

Original text of this message