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: rtrim question

Re: rtrim question

From: Izabella <Izabella.Urbanek_at_afp.gov.au>
Date: Tue, 14 Dec 1999 09:47:12 +1100
Message-ID: <833svn$2g0h$1@platinum.sge.net>


> SQL> select rtrim(c1) from delete_me1;
>
> RTRIM(C1)
> ----------
> t1

The reason you see the above is because SQL is simply trying to show you the full label. Try:

select rtrim(c1) x from delete_me1;
or
select 'X' || rtrim(c1) || 'X'from delete_me1;

and you will see that the actual value is only 2 characters;

"Peter Shankey" <shankeyp_at_charlestoncounty.org> wrote in message news:385569CB.CA419254_at_charlestoncounty.org...
> What am I missed about the rtrim function:
> If I have a table
> SQL> describe delete_me1
> Name Null? Type
> ------------------------------- -------- ----
> C1 NOT NULL VARCHAR2(10)
> and do
>
> SQL> select c1 from delete_me1;
>
> C1
> ----------
> t1
>
> I get t1 no big deal
> if I do
> SQL> select length(c1) from delete_me1;
>
> LENGTH(C1)
> ----------
> 2
>
> again this makes sense length() counts chars up to a white space
> but if I do
> SQL>
> SQL> select rtrim(c1) from delete_me1;
>
> RTRIM(C1)
> ----------
> t1
>
> why don't I see ????
> RT
> --
> t1
>
> In the case of using the dual table I get:
>
> SQL> select 't1 ' c1 from dual;
>
> C1
> ----------
> t1
>
> SQL>
> SQL> select rtrim('t1 ') c1 from dual;
>
> C1
> --
> t1
>
> SQL>
>
> It seems like rtrim() is not treating the value returned from C1 in the
> table
> delete_me1 like it is not a string. but the length function is.
> How could I rtrim the return of a varchar2 column?
>
> Thanks
> Pete
>
Received on Mon Dec 13 1999 - 16:47:12 CST

Original text of this message

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