It sounds like the trailing blanks are causing it to not match. I know MS
SQL has a rtrim() function. do you have anything comparable in Oracle? (I'm
sure you do). If so, and this is the problem, try something like:

SELECT RTRIM(name) FROM junk WHERE RTRIM(id)='1001'

(That's MS Syntax, but I'm sure Oracle will have a similar way of doing it.)


Steve Howard


-----Original Message-----
From: Guru Prasad [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 11:59 PM
To: [EMAIL PROTECTED]
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