Wednesday, 31 December 2014

Removing Special Characters from a string field in Oracle

Syntax:

Select Regexp_Replace( Column_name ,'[^[:alnum:]'' '']', Null)  FROM table_name ; 

Example: 

Select Regexp_Replace( '@#@#@##Customer_Description' ,'[^[:alnum:]'' '']', Null)  FROM dual

Explanation

The [[:alnum:]] character class represents alphabetic and numeric characters, and it is same as using [a-zA-Z0-9] in regular expression.




No comments:

Post a Comment