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: Angelo Cavallaro <angelo.cavallaro_at_pcm.bosch.de>
Date: 1998/01/20
Message-ID: <34C45A8B.7292@pcm.bosch.de>#1/1

Billy wrote:
>
> 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

Try this.
If the name of the column is PHONE.

TRANSLATE(PHONE,'*'||TRANSLATE(PHONE,'*0123456789','*'),'*') The character * is a dummy-character. TRANSLATE must have at least one replacement character, so you replace * with * and the rest with NULL. Angelo Received on Tue Jan 20 1998 - 00:00:00 CST

Original text of this message

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