Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle NULL vs '' revisited
Thomas Kellerer wrote:
> I have never understood that distinction as well. Actually everybody
> (not only the poster on OTN and here) seems to be screaming about not
> having a known no-value vor strings but no one ever complained about
> dates or numbers (and no, I don't think zero is an approriate
> subsitution for '' in this example).
> I remember that discussion on OTN and I too wanted to have an answer to
> that question ;)
This is about elementary algebra:
http://en.wikipedia.org/wiki/0_%28number%29
"In set theory, the number zero is the cardinality of the empty set: if
one does not have any apples, then one has zero apples. In fact, in
certain axiomatic developments of mathematics from set theory, zero is
defined to be the empty set. When this is done, the empty set is the Von
Neumann cardinal assignment for a set with no elements, which is the
empty set. The cardinality function, applied to the empty set, returns
the empty set as a value, thereby assigning it zero elements."
Ultimately who have to back to Models and interpretations: http://en.wikipedia.org/wiki/Model_theory
It's been 16 years since I went through this... suffice to say that: zero is the neutral element with respect to addition an empty string is the neutral element with respect to addition
I'm not aware of a matching "date" algebra. When doing math with dates you need intervals. Intervals do have a neutral element. That would be an "instant" (?) I.e. an infinitely short duration.
Note that zero is an "empty set". NULL is the absence of the set itself.
Look at VARRAY.
When you accept a string as a set of characters and you model that as a
VARRAY you can clearly see the distinction between an empty VARRAY (of
CHAR(1)) and a NULL VARRAY.
Cheers
Serge
-- Serge Rielau DB2 Solutions Development IBM Toronto LabReceived on Sat Aug 18 2007 - 09:23:57 CDT