Actually that the way Oracle uses the char type.  Anything inserted under
the 5 characters gets filled with blanks, therefore you should be looking
for '1001 '.  Varchar trims the trailing spaces and therefore when you
insert '1001' that's what's in the field.

Ilya Sterin

-----Original Message-----
From: Guru Prasad
To: [EMAIL PROTECTED]
Sent: 02/26/2001 10:59 PM
Subject: Problem with CHAR Data Type in ORACLE


Dear Friends,

I am unable to get any records using SELECT command. I tried the
following
SQL statement.

        "select name from junk where id='1001'"

the field 'id' is of type CHAR(5). I didn't get any records ( when i am
sure that the data is available for '1001' ). If i changed the data type
to VARCHAR(5), it is working fine. Why is it so ?

Is there any solution for this one. Any patchup ?. I can't use
VARCHAR(5) 
b'coz in our CLIENT system, they use only 'CHAR'.

I am using DBI Version 1.14.

Any help would be greatly appreciated.

Thanx in Advance.

guru.
bk SYSTEMS.

P.S: Don't ask me to use "select name from junk where id like '1005%'",
as
i know this works but it is not an elegant way of doing it.
  



Reply via email to