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: 'hello world' != '' does not work?

Re: 'hello world' != '' does not work?

From: C. Ferguson <c_ferguson_at_rationalconcepts.com>
Date: Fri, 16 Mar 2001 23:36:19 GMT
Message-ID: <3AB2A38C.59513896@rationalconcepts.com>

Hi Jeffrey,
  no bug. The empty string is interpreted as null by Oracle. The comparison to use against a null value is: IS NULL or IS NOT NULL.

e.g. 'hello world' is null;

      'hello world' is not null;

Now to compare against another non null string:

    'hello world' != 'Goodby cruel world';

hth,
cindy

Jeffrey Boulier wrote:

> Hi folks,
>
> We're running into a strange problem with != . It works for
> numerics, but not for strings.
>
> produser_at_PROM> select sysdate from dual where 1 != 0;
>
> SYSDATE
> ---------
> 16-MAR-01
>
> user_at_DB> select sysdate from dual where 'hello world' != '';
>
> no rows selected
>
> Any thoughts? Is != not valid for comparing strings in Oracle, or have we
> run into a bug? Our database is 8.1.6.3.
>
> Yours Truly,
> Jeffrey Boulier
> --
> Community Source & Support
> ------=>Prometheus<=------
  Received on Fri Mar 16 2001 - 17:36:19 CST

Original text of this message

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