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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle NULL vs '' revisited

Re: Oracle NULL vs '' revisited

From: Serge Rielau <srielau_at_ca.ibm.com>
Date: Sat, 18 Aug 2007 08:31:22 -0400
Message-ID: <5io74gF3q40sfU1@mid.individual.net>


Martin T. wrote:
> If you also use other DBs besides oracle just make the column NOT NULL
> and treat '' as ''.
>
> Simple(?) as that.

WHERE c1 = '' will behave differently.
Unless NULL = NULL, which I recall from a past discussion is not the case.

Others introduced the notion of a "known unknown". I think '' is a known absense of a value (I cringe since '' to me is a value like 0). NULL is unknown. Undecidable. It is an integral part of the predicate logic.

Similar problems appear with LENGTH(SUBSTR('Hello', 1, 0)). Shouldn't it be 0? Just like in CONCAT NULL is "treated" as an empty string. IMHO, following that logic, LENGTH(NULL) = 0, alas it is not. For "most" functions NULL in means NULL out...

Cheers
Serge

-- 
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Received on Sat Aug 18 2007 - 07:31:22 CDT

Original text of this message

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