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 VARCHAR2 Data

Re: Trailing Spaces on VARCHAR2 Data

From: Richard 'Frog' Barrott <u952297_at_student.canberra.edu.au>
Date: Sat, 12 Dec 1998 11:05:15 +1100
Message-ID: <Pine.SOL.3.95.981212110143.18792A-100000@student.canberra.edu.au>


On Fri, 11 Dec 1998, Gene Hubert wrote:

> I'm running Oracle 8.0.3 on NT 4.0.
> 
> I occasionally run across data in varchar2 columns that has
> trailing spaces. Comparisons on this data will fail without an
> rtrim or adding the right number of spaces to what is being
> compared. Can anyone explain how varchar2 data ends up with
> trailing spaces? I thouhgt this was not possbile.
> 

Hi Gene.
VARCHAR2 is a variable length character type (unlike CHAR, which is fixed). What may be happening (I'm not 100 % sure) is if you're inserting data that's has spaces on the end, it will become part of data for that row.

I don't think that VARCHAR2 automattically strips spaces. I vaguely recall having problems cos of this in the past. Make sure the data going in is 'clean', or strip it afterwords.

Hope this helps...

Received on Fri Dec 11 1998 - 18:05:15 CST

Original text of this message

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