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 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Welcome to My Oracle World Puneet Rajkumar

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today