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

From: David Cressey <>
Date: Mon, 28 Nov 2005 11:39:10 GMT
Message-ID: <y%Bif.6277$>

"Frank Hamersley" <> wrote in message news:A7wif.5513$

> 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?

The engineers are not infinite in their wisdom.

The most robust solution for storing NULLS is a bit vector stored with each row, that indicates whether data is present or not present in each of the cells. However, this adds overhead. DEC Rdb did it this way. DEC's solution has the overhead, even in cases where a coulmn is declared NOT NULL. Oracle chose to indicate a null by the "impossible values" method. For example, A NULL in a NUMBER is represented by minus zero. A single zero byte is used to represent a NULL in a VARCHAR. Unfortunately, an empty string, having length zero, gets the same representation. Oops!

I don't know about Sybase. Received on Mon Nov 28 2005 - 12:39:10 CET

Original text of this message