How to format string?

Question:

> Does anyone know how to select a char(9) column containing a phone number
> and return the value
> formatted in a "(###)###-####" string?

Answer:

IMO the best way to do this is make sure the format is ensured upon entry
and stored in the database.
Forms (and other front-ends) should be able to do this.
Now you will be forced to do something like this
'('||substr(phone,1,3)||')'||substr(phone,4,3)||'-'||substr(phone, 7)

Hth,
Sybrand Bakker, Oracle DBA
 
 
 
 

Hosted by www.Geocities.ws

1