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 -> Binding on a char column

Binding on a char column

From: silvia.fama <silvia.fama_at_googlemail.com>
Date: 17 Jan 2007 05:20:41 -0800
Message-ID: <1169040040.816745.9780@l53g2000cwa.googlegroups.com>


Hi!
I'm using bind variables to execure select sql queries on my oracle database (version 9 and version 10).
My database contains some char columns (char (50), char(1), etc)

Using bind variables I have a problem with trailing blanks at the end of the string in a char column. I mean that if I insert in a column of char(10) type 'test' string, I will have in oracle db 'test ' string (with trailing blanks).
When I bind that column searching for 'test' string I'd need to RTRIM the column:
select * from TABLE where RTRIM(col1) =:bind1 where bind1 will be associated to test.
If my query is:
select * from TABLE where col1 =:bind1
I will not have the result expected if bind1 is 'test', I should bind 'test ' with blank.

So, I know that RTRIM is not good for performance, does oracle gives me the possibility to work into another way?

I hope to be clear!
Thanks! Received on Wed Jan 17 2007 - 07:20:41 CST

Original text of this message

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