I was wondering if anyone could be so kind to help me create a user-defined function that would do the following:
The function would take an input number from 1 to 9999999 and spit out every possible letter combination of these numbers based on the number-to-letter equivalents displayed on every phone. Here's the background on why I want to do this: My company has a whole bunch of 800 numbers in inventory that we use on our ads. We want to convert these numbers to vanity associations. That is, we want to make it easier for people to remember our phone numbers by providing word equivalents to the numbers. For example, 800-CALL-NOW rather than 800-225-669. I want to be able to enter the last 4-7 digits of every phone number into the function and have it return every possible letter combination. I can then review the output to see if any of the letter combinations actually spell out a valid word.
Here's the mapping in case anyone needs it:
1 = 1 [Doesn't have a letter association]
2 = A, B, C
3 = D, E, F
4 = G, H, I
5 = J, K, L
6 = M, N, O
7 = P, Q, R, S
8 = T, U, V
9 = W, X, Y, Z
0 = 0 [Doesn't have a letter association]
Example:
exec mynewfunction(435) would produce:
GDJ
GDK
GDL
HDJ
HDK
HDL
IDJ
IDK
IDL
GEJ
etc.
The function would take an input number from 1 to 9999999 and spit out every possible letter combination of these numbers based on the number-to-letter equivalents displayed on every phone. Here's the background on why I want to do this: My company has a whole bunch of 800 numbers in inventory that we use on our ads. We want to convert these numbers to vanity associations. That is, we want to make it easier for people to remember our phone numbers by providing word equivalents to the numbers. For example, 800-CALL-NOW rather than 800-225-669. I want to be able to enter the last 4-7 digits of every phone number into the function and have it return every possible letter combination. I can then review the output to see if any of the letter combinations actually spell out a valid word.
Here's the mapping in case anyone needs it:
1 = 1 [Doesn't have a letter association]
2 = A, B, C
3 = D, E, F
4 = G, H, I
5 = J, K, L
6 = M, N, O
7 = P, Q, R, S
8 = T, U, V
9 = W, X, Y, Z
0 = 0 [Doesn't have a letter association]
Example:
exec mynewfunction(435) would produce:
GDJ
GDK
GDL
HDJ
HDK
HDL
IDJ
IDK
IDL
GEJ
etc.