0
votes

How do you define a format mask in Oracle APEX for social security numbers and phone numbers?

I know how to do this in PLSQL but in APEX we just get the "Format Mask" box and it seems to only want to format dates and currency. I want to format my number like 999-99-9999 or 999-999-9999.

Thank you in advance.

2

2 Answers

0
votes

I don't think you can format numbers this way with TO_CHAR. Honestly, I'm not sure these really should be numbers. They're really more strings of numeric characters in my book. You probably want to make a custom function and use that in the formatting section.

0
votes

Alternately, you could use the HTML Expression feature for the field to display in your desired format. But you can't use that as a data entry format in a single field, where the user types in the numbers and you pop up the hyphens as they type. It's only for display-only fields.

Another option would be to have 3 fields, one for each part of your saved data value (e.g. area code, exchange, number).