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: eliminate the characters which are not in the specified list of characters

Re: eliminate the characters which are not in the specified list of characters

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: Fri, 15 Jun 2007 05:37:17 -0700
Message-ID: <1181911037.917720.99020@m36g2000hse.googlegroups.com>


On Jun 15, 2:50 pm, Vijay <avbhaskarre..._at_gmail.com> wrote:
> I want to display the character from the selected list only.
> i want to eliminate the characters which are not in the specified list
> of characters
>
> For expamle...
> Specified list of characters: (a-z 0-9),
>
> my input string is: test for string
> output string should be : testforstring
>
> Please help
>
> Thanks in advance,
> Vijay

See TRANSLATE built-in function. It doesn't support RE-like specifications, but otherwise it does what you want. For your test case, something like this would do:

SQL> SELECT TRANSLATE('test for string','x ','x') FROM SYS.DUAL;

TRANSLATE('TE



testforstring

This example only removes spaces from the source string.

Hth,

   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm)    http://www.dynamicpsp.com Received on Fri Jun 15 2007 - 07:37:17 CDT

Original text of this message

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