Wednesday, 4 June 2014

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 

3 comments: