Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: 'hello world' != '' does not work?
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
![]() |
![]() |