Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: VARCHAR2 and trailing spaces - what's going on!
dnh wrote:
> On Mon, 30 Sep 2002 10:42:35 GMT, Kenneth Koenraadt wrote:
>
> Hi Kenneth, Richard
>
> I know what it does and, in a way, why; but I'm sure I've read in many
> places that varchar2s strip off spaces - am I imagining that detail or
> is some documentation in error???
>
> nigel
>
I think what you might have read is that CHAR always *pads* with spaces;
but VARCHAR2 always *leaves* spaces and never *pads* with spaces. When I
used to work with Oracle Forms, we always stored user input fields as
'ltrim(rtrim(field))' for that very reason ... didn't want users saying
they couldn't query on a field that had non-printing characters. Oracle
would refuse to find the record, but when they called the data onto the
screen using a different query, sure enuf, they could point to the
screen and say: "See?" And only after I went back to my desk and did a
'select dump(field)' could I really see why.
Received on Mon Sep 30 2002 - 11:32:32 CDT