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

Home -> Community -> Usenet -> c.d.o.misc -> Re: empty string == NULL

Re: empty string == NULL

From: Ed Prochak <prochak_at_my-deja.com>
Date: Tue, 28 Dec 1999 17:35:37 GMT
Message-ID: <84arve$7eq$1@nnrp1.deja.com>


In article <38615f57.0_at_news.uni-ulm.de>,   "Andreas Steidle" <andreas_at_fh-konstanz.de> wrote:
> From the oracle doc:
>
> Do not use null to represent a value of zero, because they are not
> equivalent. (Oracle currently treats a character value with a length
of zero
> as null. ... [1])
>
> Is there a workround for this contardictory semantik garbage? A string
is a
> string, even if it's empty!!! Perhaps some env-var??
> In other words: Is there a way to make Oracle remember a '' and NOT
convert
> it to NULL ???
>
> thanx, Andreas
>
> [1] However, this may not continue to be true in future releases, and
Oracle
> recommends that you do not treat empty strings the same as NULLs.
>
> Hope this will happen very soon as default behavoir.
>

I am puzzled by your charaterization of this contraint as "symantic garbage". Zero is not NULL, you seem to agree with that. It's the string that you don't like, right? That is, right now, ORACLE treats a '' (empty string) as a NULL but you want to be able to distinguish between them. So let me ask a simple question:

How would you load (via SQL*Loader) the empty string ('')?

I would a lot on conversions, so my concern is real, not theoretical.  How would I get a data file that has an empty string? How would a user running a SQL script enter it?

Once I have it in the table, what good is it? Let's see:

      select * from test where column1 = '' ;

Okay, the syntax makes sense.
Where would it sort in an ORDER BY clause? (first? I guess)

I just don't see the usefulness of making the distinction. Why do you need such a workaround??

Technically I can see that they could have done something different, but since it works that way, I don't see a problem.

--
Ed Prochak
Magic Interface, Ltd.
ORACLE Development, conversions, training and support 440-498-3700 magic_at_interfacefamily.com

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Dec 28 1999 - 11:35:37 CST

Original text of this message

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