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: Blank String problems

Re: Blank String problems

From: chensm <chensm_at_sesrcs1.src.se.bp.com>
Date: Mon, 28 Jun 1999 17:37:16 +0800
Message-ID: <7l7fd0$ce3@eugwy1.bp.com>


This is because '' is null in Oracle. And if anthing want to compare with null, it should use is null. If you use = or <>, it will return null. While oracle return the record only when the logic value is true, no value retured for false and null.
It is a strange thing to have tri-value for a logic expression, isn't?

dean.taplin_at_intrinsic.co.uk wrote in message <7l7a0o$b5c$1_at_nnrp1.deja.com>...
>I have an SQL statement that contains the following criteria:
>
>and V.code1 is not null
>and V.code1 <> ''
>and V.code1 <> ' '))
>
>On Oracle the above statement returns zero rows. If I remove the
>second line containing '' so that the SQL now reads:
>
>and V.code1 is not null
>and V.code1 <> ' '))
>
>The number of rows returned is no longer zero. Why is this so?
>
>This SQL statement works fine on all other database platforms. For
>Oracle '' is the same as NULL and since I am testing for '', ' ' and
>NULL I do not why I am getting different behaviour when I run this SQL
>statement on Oracle.
>
>Any comments appreciated.
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Mon Jun 28 1999 - 04:37:16 CDT

Original text of this message

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