Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NULL versus empty string
It was an implementation decision made back when storage was small and
expensive. Instead of using separate null and length fields, the database
"doubles up" the use of a single field to represent both null and length and
thus saves a few bytes of storage.
"David Wall" <d.wall_at_computer.org> wrote in message
news:KcOj9.2$Yy5.392_at_news03.micron.net...
> What's the apparent rationale for Oracle treating an empty string and a
NULL
> value as the same? I have a NOT NULL VARCHAR2 field, and I cannot enter
an
> empty string since it rejects it as being null. However, null in other
> databases means that the attribute is not set, not that it's just empty.
> Most programming languages understand the difference between "" (an empty
> string) and null/0, meaning nothing is set.
>
> Is there a comparable feature in Oracle that I can set that prevents it
from
> being NULL, but will allow an empty string in a VARCHAR2?
>
> Thanks,
> David
>
>
Received on Tue Sep 24 2002 - 08:37:32 CDT