Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Use of varchar2 - please help!
One possible reason is that the variables are defined as char in your
table. When you compare varchar2 with char, you may have trouble without
use rtrim function.
To see this,
SQL> desc t1
Name Null? Type ------------------------------- -------- ---- UNAME VARCHAR2(15) USERNAME CHAR(20)
SQL> select * from t1;
UNAME USERNAME
--------------- --------------------
john john
SQL> select * from t1
2 where uname=username;
no rows selected
SQL> select * from t1
2 where uname=rtrim((username));
UNAME USERNAME
--------------- --------------------
john john
SQL> select * from t1
2 where username='john';
UNAME USERNAME
--------------- --------------------
john john
SQL> select * from t1
2 where uname='john';
UNAME USERNAME
--------------- --------------------
john john
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Tue Jun 15 1999 - 07:28:40 CDT
![]() |
![]() |