Re: help please

From: Guido Konsolke <Guido.Konsolke_at_triaton.com>
Date: Mon, 27 Jan 2003 12:04:51 +0100
Message-ID: <1043665404.132059_at_news.thyssen.com>


Hi Oscar,
some comments follow.

"Oscar" <oscar_at_j.com> wrote...
> 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,
See comment below: ^^^^

> SUBSIST CHAR (20) NULL,
> PID CHAR (10) NULL,
> FIPROGRA CHAR (20) NULL,
> NUMPROCE CHAR (5) NULL)
> ;
(snip)
> 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)

I doubt that. Explanation below.

> Select 3 --> 0 row ( it should be 3) ???????????????? What i'm
> doing wrong !
(snip)

Ok, here we go.
1. You define your column programa as CHAR. That means, any

   given value will be padded with blanks. Taking that as a    fact I can't believe that you get more than 0 back from    your second query.
2. You set the column to NULL in 3 of your inserts. So you

   have to use the NVL funcion or the IS NULL comparison    to get those rows.

Please have a look at the docs how to go on.

Good luck,
Guido Received on Mon Jan 27 2003 - 12:04:51 CET

Original text of this message