oracle - How can I format a number as xxx-xx-xxxx? -
I ask for social security number data from a stored procedure and I format it as a social security number in my security Want process
How can I format xxx-xx-xxxx such as xxxxxxxxx in Oracle?
SSN formatting with TO_CHAR
SELECT TO_CHAR (012345678, '000g00g0000', 'nls_numeric_characters = .-') from SSN double; SSN ----------- 012-34-5678
Update: Thank you for Gary that the '0' format character To preserve leading zero, '9' should be used instead.
Comments
Post a Comment