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: NULL versus empty string

Re: NULL versus empty string

From: Michael Gast <mig-sm_at_web.de>
Date: Mon, 30 Sep 2002 11:29:59 +0200
Message-ID: <3D981997.20600@web.de>


Hi Tim,

Tim schrieb:
> I would guess that the logic is that if you don't want to allow null,
> then you want an actual value and "" while not being null, is not really
> a value conceptually. I mean, if "" was acceptable, why not just allow
> null?

NULL means: 	I have no value
"" means:	I have the value ""

The difference is more obvious using a number datatype:
NULL means:	I have no value (as before)
0 means:        I have the value 0

For me, there is a big difference between NULL and a value valid for the column. If you do for example
SELECT SUM(<col>) FROM <table>
you will get the value NULL if your column cotains NULL values but you will get a numeric result when you have 0 stored instead of NULL. In this case, calulations depending on this result could be false (e.g. average).

-- 
Due to spam, this email address is only used for newsgroup postings.

All emails sent to this address are immediately deleted. Therefore any 
eMails sent directly to this address never will be answered.

Mit freundlichen Grüßen / Best Regards
Michael Gast
SEPP MED GmbH
Received on Mon Sep 30 2002 - 04:29:59 CDT

Original text of this message

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