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 problem

Re: rtrim problem

From: <rtproffitt_at_my-deja.com>
Date: Fri, 05 Nov 1999 17:35:37 GMT
Message-ID: <7vv4h9$vf0$1@nnrp1.deja.com>


Just for the sake of argument, I did figure out a way to do this... but I think it will work only on the exact phrase...

Using Only RTrim, here is the solution: select '>'||
  rtrim(
    rtrim(

      rtrim('Colgate Total 100ml tuba',
            'Colgate Tt0mub'),

    'ColgateT1')
   ) ||'<'
from dual;

The angle brackets only outline the text. Explanation:
RTRIM(char,set) is defined as follows:
"char, with final characters removed
after the last character NOT in set.
set defaults to ' '".
Sql Quick Reference [my emphasis added]

Therefore:
a. The inner Rtrim trims up to the 1.
>Colgate Total 1<

b. The next outer one Trims off the one by "not including" blank.
>Colgate Total <

c. The last one Rtrims the blank.
>Colgate Total<

Robert Proffitt
Beckman Coulter
Brea California

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Nov 05 1999 - 11:35:37 CST

Original text of this message

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