• Categories
  • Search
Friday, July 13, 2012

Remove Special Characters from String

To Remove Special Characters Use following Replace Functions

REGEXP_REPLACE(<Your_String>,'[^[:alnum:]'' '']', NULL)

 

Example --

SELECT REGEXP_REPLACE('##$$$123&&!!__!','[^[:alnum:]'' '']', NULL) FROM dual;

 

OutPut –

123

 

OR

 

Use TRANSLATE function as given below

 

Example --

SELECT translate('##$$$1$$2#3&&!!__!', '[0-9]#$&&!_','[0-9]') FROM dual;

 

OR

 

SELECT translate('##$$$123&&!!__!', '0#$&&!_','0') FROM dual;

 

OutPut –

123 

Join the discussion

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
 

Visit the Oracle Blog

 

Contact Us

Oracle

Integrated Cloud Applications & Platform Services