Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle NULL vs '' revisited
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 LabReceived on Sat Aug 18 2007 - 07:31:22 CDT
![]() |
![]() |