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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Phone # format

RE: Phone # format

From: Bob Metelsky <bmetelsky_at_cps92.com>
Date: Thu, 15 May 2003 07:51:11 -0800
Message-ID: <F001.005999FD.20030515075111@fatcity.com>


Run this and you will probably find that it is wrong ...  

select '(' ||substr(phone_number,1,3)||')-' ||  substr(phone_number,3,3) ||'-'||
substr(phone_number,6)from phone_numbers ;  

##############################################
I see, I had the type of 6 instead of 7 in the last substr  

here is my "working" example ;-)  

create table phone_numbers(
phone_number char(10) ) ;  

insert into phone_numbers
(phone_number)

values('1112223333');  

 select '(' ||substr(phone_number,1,3)||')-' ||  substr(phone_number,4,3) ||'-'||
 substr(phone_number,7) from phone_numbers;  

thanks to all who replied, I appreciate the suggestions even though I didn't give it enough thought myself (too much going on...).  

Also, let me take this opportunity to congratulate Dennis on his progress with OCP and contributions to the list  

bob

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Bob Metelsky
  INET: bmetelsky_at_cps92.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Thu May 15 2003 - 10:51:11 CDT

Original text of this message

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