SSN Format in Oracle

I'm using the following code to format the ssn#s :
to_char(replace(emp.fica_nbr,'-'),999999999) SSNBR

The only issue is if a ssn# starts with 0, it is being omitted.
How can I adjust the code to capture all numbers, even if the leading one is a 0?
metalteckAsked:
Who is Participating?
 
johnsoneConnect With a Mentor Senior Oracle DBACommented:
If you insist on the TO_CHAR, then this would do it, but you are doing a lot of unnecessary conversion.

to_char(to_number(replace(emp.fica_nbr,'-')),'000000000')
0
 
johnsoneSenior Oracle DBACommented:
What is the TO_CHAR for?  It is already a character field.  You just need to remove the -

replace(emp.fica_nbr,'-') SSNBR
0
All Courses

From novice to tech pro — start learning today.