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: trailing spaces on a varchar2 select

Re: trailing spaces on a varchar2 select

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Wed, 17 Nov 1999 17:46:43 +0800
Message-ID: <38327983.6E5@yahoo.com>


afryer_at_my-deja.com wrote:
>
> I'm using embedded SQL to select a varchar2 datatype from a table. We
> are using Oracle7.3.4. The problem is that Oracle seems to append
> spaces up to the size that the varchar2 datatype is defined as for the
> table. Is there some way I can stop Oracle appending spaces onto the
> returned value?
>
> Thanks,
>
> Anthony
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

What tool are you using to select...

On any oracle version I've worked with, varchar2 is exactly that, variable length - no spaces appended anywhere...

try

select col, length(col), length(rtrim(col)) from table

to see if the space are actually on the table rows...

HTH
--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Wed Nov 17 1999 - 03:46:43 CST

Original text of this message

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