Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: formating
You cannot do it with a format mask I'm afraid..... I tried some things with translate but I don't use it often, so here's my solution or two cents, whatever you want to call it:
SQL> create table a( a varchar2(10) );
Table created
SQL> insert into a( a ) values ( '1234567890' );
1 row inserted
SQL> commit;
Commit complete
SQL> select '(' || substr( a.a, 1, 3 ) || ')' || substr( a.a, 4, 3 ) || '-' || substr( a.a, 7 ) AS tel no from a a;
TEL NO
SQL> This will work, as long as you have the same type of numbers in your column....
HTH,
-- Bastiaan Schaap "Dear God! What's on the end of that leash?" "I tamper with nature as a hobby." --Received on Thu Jun 21 2001 - 02:03:27 CDT
![]() |
![]() |