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: SQL to remove char from string?

Re: SQL to remove char from string?

From: Pavel Polcar <pavel.polcar_at_berit.cz>
Date: 1998/01/20
Message-ID: <01bd2577$afc79330$504331c3@polcar_nt4002>#1/1

Hi,

you can do it with the following statement

update your_table set your_string=TRANSLATE(your_string, '0123456789abc...ABC...+@...','0123456789');

Instead of dots you must write out all the small letters, all the capital letters and all the further characters that you want to remove.

Unfortunately there does not seem to be a function analogous to TRANSLATE that would leave in place only those characters specified in the string and remove all the others.
You could also use a series of statements of the type (one statement for each character you want to remove):

update your_table set your_string=REPLACE (your_string,'+');

Hope this helps.

Pavel

Billy <123456781_at_ix.netcom.com> wrote in article <34C427A2.8A0DFA96_at_ix.netcom.com>...
> Hi Everybody!
>
> I need to remove all characters from a string like (888)555-1212 and
> just leave the numbers 8885551212. Some strings could have + signs or
> other stuff like @, klondike 999-1111. I just want to remove any
> non-numeric characters.
>
> Please help. I'm only 12.
>
> Thanks,
> Billy
>
>
Received on Tue Jan 20 1998 - 00:00:00 CST

Original text of this message

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