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: tony <tony_at_littlebushsys.demon.co.uk>
Date: Wed, 19 Jan 2000 08:16:12 +0000
Message-ID: <388572CC.559602D4@littlebushsys.demon.co.uk>


 I think you may be getting formatting confused with the data returned, try using format to set the return size, as by default it will use the length defined in the data dictionary.

Nancy wrote:

> it is working. sqlplus is using the a combination of column heading and
> data length to determine the display with. had you use rtrim(t1,'1') => t
> with an apparent width based on the rtrim(t1,'1') column heading. the way
> to checkout exactly what is happening is to select t1, rtrim(t1),
> rawtohex(t1) from sadsadad . any space will be denoted by hex code '20' for
> ASCII
>
> Peter Shankey wrote:
>
> > 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 Wed Jan 19 2000 - 02:16:12 CST

Original text of this message

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