sgursahaney
Programmer
I need a DB2 function that removes the alphabetic characters from a column value. For example, I have a PHONE_NUMBER column that is supposed to have only numeric characters. But over the years, users have been putting additional characters in this field (e.g. "(800) 555-1212" or "TEL 800-555-1212"
. What I would like to do is only retrieve the numeric portion of the column value (e.g. "8005551212"
.
I have a function that I got to work, but I have to use it in several places and it is making my SQL statement excessively long. Does anybody know a simple function that can return to me only the numeric values from a character field?
I have a function that I got to work, but I have to use it in several places and it is making my SQL statement excessively long. Does anybody know a simple function that can return to me only the numeric values from a character field?