LarrySteele
Programmer
So I'm going to validate SSN's (9 numbers) coming in from an external source. I didn't find any isSSN functions out there, but came up with the following:
This should return '9' for valid SSN's, and something else for invalid SSN's. I figure I'll just create an isSSN function. Before I do, wanted to see if there might be a better way to accomplish this.
Thanks,
Larry
Code:
select length('123456789') || LENGTH(TRIM(TRANSLATE('123456789', '0123456789',' ')))
from dual;
This should return '9' for valid SSN's, and something else for invalid SSN's. I figure I'll just create an isSSN function. Before I do, wanted to see if there might be a better way to accomplish this.
Thanks,
Larry