Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle NULL vs '' revisited
Thomas Kellerer wrote:
>
>
> Serge Rielau wrote on 17.08.2007 19:38:
>>> I would be interested: if this is important for character columns, >>> then I assume this is important for other columns as well. >>> How do you implement that distinction for e.g. NUMBER or DATE columns?
>> If I get an assignment and I hand in an empty sheet that would be well >> empty. I typed zero characters. >> If I don't hand it in it is missing. It is not decidable whether my >> work is good or bad, long short.. there is the NULL.
Depends on your data model doesn't it? What if the table looks like this:
STUDENT EXAM1 EXAM2 Bob 75 82 Tom 83 Kristi 94 92 Chick 56 47
So what does the entry for Tom in EXAM2 mean? There is a row in the table after all!
>> For numbers I think one can reasonably argue that 0 is the equivalent >> of empty.
I don't think that I'd ever equate 0 to empty for numbers. But maybe that's the mathematician in me. When computing averages or min values, a 0 can have a profound affect on the result where as no value can mean something else. Take for example the following set of numbers:
{0, 11, 22, 33, 44}
The average is 22 and the min is 0. Now take these numbers:
{NULL, 11, 22, 33, 44} Now the average is 27.5 and the min is 11.
So for those reasons, I would not reasonably argue that 0 is the equivalent of empty. Of course...it does depend on how you are going to use this data. There are cases where it does not make any difference.
>> I don't think that there is a similar "empty" concept for dates.
>> Question: If empty strings make no sense for VARCHAR, why have them >> for CLOBs? AFAIK Oracle has helper functions to produce empty lobs.
Agreed.
Cheers!
Brian
-- =================================================================== Brian Peasland dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - Unknown -- Posted via a free Usenet account from http://www.teranews.comReceived on Fri Aug 17 2007 - 13:33:22 CDT
![]() |
![]() |