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: Help please !

Re: Help please !

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Mon, 27 Jan 2003 13:30:35 +0300
Message-ID: <b131og$lu5$1@babylon.agtel.net>


You can't compare NULL to anything - the result would be not "equal" or "not equal", but NULL (unknown). And empty strings are NULLs in Oracle (at least as of now, promised to be changed in some future version.) Hence, your result. Change your WHERE clause to (IS NULL or <>) and you'll get what you expect.

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Oscar" <oscar_at_j.com> wrote in message news:b130qi$hhd$1_at_nsnmrro2-gest.nuria.telefonica-data.net...

> I create a tabe. Then I insert some values, when I make the query = i got 1
> row but what about diferent ?
>
> drop table XCOLA
> ;
> CREATE TABLE XCOLA (
> IDEN CHAR (7) NULL,
> EQUIPNAME CHAR (20) NULL,
> COLANAME CHAR (20) NULL,
> ESTADO CHAR (20) NULL,
> PROGRAMA CHAR (20) NULL,
> SUBSIST CHAR (20) NULL,
> PID CHAR (10) NULL,
> FIPROGRA CHAR (20) NULL,
> NUMPROCE CHAR (5) NULL)
> ;
> CREATE UNIQUE INDEX IXCOLA ON XCOLA (IDEN, EQUIPNAME, COLANAME)
> ;
> insert into xcola values ('0','SERVIDOR' ,'CGAUTO','PARADA','GL215','','0','
> ','1')
> ;
> insert into xcola values ('0','SERVIDOR' ,'CGJOBD','ACTIVA','','','0','
> ','1')
> ;
> insert into xcola values ('0','SERVIDOR' ,'CGJOBQ','ACTIVA','','','0','
> ','1')
> ;
> insert into xcola values ('0','SERVIDOR' ,'CGPOST','ACTIVA','','','0','
> ','1')
> ;
> select count(*) from xcola
> ;
> select count(*) from xcola where programa='GL215'
> ;
> select count(*) from xcola where programa<>'GL215'
> ;
>
> Select 1 --> 4 rows (ok)
> Select 2 --> 1 row (ok)
> Select 3 --> 0 row ( it should be 3) ???????????????? What i'm
> doing wrong !
> I'm using ORACLE 8.1.7 but with 9.2 same !!!!!
>
>
> Thank's OSCAR.
>
>
Received on Mon Jan 27 2003 - 04:30:35 CST

Original text of this message

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