Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: extra character at the end of data?

Re: extra character at the end of data?

From: Scott Mattes <ScottMattes_at_yahoo.com>
Date: Thu, 03 Jan 2002 21:28:59 GMT
Message-ID: <v24Z7.1289$gO5.886379@news1.news.adelphia.net>


If it doesn't return anything when you query with a trailing space either there is more than one space or some non-displayable character.

You might try doing a 'select rawtohex( field_name ) from yourtable' to see just exactly is there.

If it is trailing spaces, you could probably remove them by updating the table and setting the field equal to rtrim( ) of that field.

"John" <jriker1_at_yahoo.com> wrote in message news:e6bb5a8d.0201031149.42e10df3_at_posting.google.com...
> I just inherited a database and to my dismay, my sql statements were
> failing to return results most of the time. I have a list of
> countries, and when I return a distinct on that list, placing " "
> characters before and after the data, there seems to be an extra space
> at the end of most of the countries. (Data visually returned: "UNITED
> STATES ". The field is a NOT NULL VARCHAR2(50) field. If I do a:
>
> country = 'UNITED STATES'
>
> it returns no results. If I do a:
>
> country like 'UNITED STATES%'
>
> it returns the US entry.
>
> If I just do a:
>
> country = 'UNITED STATES '
>
> with a space at the end, it fails to return anything.
>
> Any ideas what is going on here? A couple of the countries return
> with no extra blank looking spaces, and those work fine. Thanks.
>
> JR
Received on Thu Jan 03 2002 - 15:28:59 CST

Original text of this message

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