Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help to Clean Up Phone Numbers

Status
Not open for further replies.

jschodde

Technical User
Jan 28, 2001
42
US
I have a database with a phone number field that can have any combination of digits and characters in it. Some people have even type in names, notes, and other junk.

I don't care what they wrote, I just need to remove all the characters EXCEPT digits '0123456789'.

Can anyone help me on this? I need it to be part of a select statement and not a stored procedure, etc.

Thanks,
Jeff

 
Try doing a double translate on your input string, something like :-


select translate('XYZ0123ABC','0'||translate('XYZ0123ABC','*0123456789','*'),'0)
from dual


=> 0123
 
Good idea! I'll try that.
Thanks,
Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top