Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: So what's null then if it's not nothing?

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

From: David Cressey <david.cressey_at_earthlink.net>
Date: Mon, 28 Nov 2005 11:39:10 GMT
Message-ID: <y%Bif.6277$N45.581@newsread1.news.atl.earthlink.net>

"Frank Hamersley" <terabitemightbe_at_bigpond.com> wrote in message news:A7wif.5513$ea6.729_at_news-server.bigpond.net.au...

> 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 - 05:39:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US