Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: formating

Re: formating

From: Bastiaan Schaap <address_at_nomail.com>
Date: Thu, 21 Jun 2001 09:03:27 +0200
Message-ID: <UTgY6.1$776.274@psinet-eu-nl>

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



(123)456-7890

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US