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 -> Re: VARCHAR2 and trailing spaces - what's going on!

Re: VARCHAR2 and trailing spaces - what's going on!

From: Karsten Farell <kfarrell_at_medimpact.com>
Date: Mon, 30 Sep 2002 16:32:32 GMT
Message-ID: <A0%l9.848$JP.83034294@newssvr13.news.prodigy.com>


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

Original text of this message

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