Re: Need Help with SQL Plus in 8i

From: Thomas Olszewicki <ThomasO_at_noSpm.cpas.com>
Date: Sun, 10 Feb 2002 21:09:52 GMT
Message-ID: <AkB98.4933$LL.403_at_news1.bloor.is>


CREATE TABLE TESTPHONE (phone char(10)); INSERT INTO TESTPHONE VALUES ('4163334455'); -- Number
SELECT TO_NUMBER(phone) phone FROM TESTPHONE; -- Formatted string
SELECT '('||Substr(phone,1,3)||')'||

       ' '||Substr(phone,4,3)||'-'||
       Substr(phone,7) phone

FROM TESTPHONE; HTH
Thomas

"Sergiu gp" <sergiugp_at_aol.com> wrote in message news:20020210135415.02129.00000809_at_mb-ch.aol.com...
> Hello guys, I am trying to perform a query on a table where there is a
'phone'
> column that has datatype char. I must convert it into a number and format
it as
> follows: '(999) 999-9999' . I can't seem to find a way to do this
correctly. I
> am using the command TO_NUMBER(phone, '(999) 999-9999'). I keep getting an
> illegal number format error. Can someone help?
>
> Thanks a bunch!
Received on Sun Feb 10 2002 - 22:09:52 CET

Original text of this message