On the move:

I'm currently moving the following to their own blogs: Unix, HTML for Blogs, Perl & Java.
The links are on the left side.

Saturday, October 4, 2008

Display All the Digits in a String (pre 10)

Conn hr/hr

Select Translate(Phone_Number,
' !"#$%&''()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~' ,' ') As
Digits,
Phone_Number
From Employees;
With version 10, you can use Regexp_Replace as shown:
Select Regexp_Replace('abcABC123^&*','[^[:alnum:]]') 
From Dual
SQL> /

REGEXP_RE
---------
abcABC123

No comments:

Post a Comment