Formatting Phone Number

Man I'm trying to format a 10 digit phone number to display as (xxx)xxx-xxxx... how do i do it? I'm very green w/ sql... Any help please!?

use a SUBSTR() here is an example.
SQL> select '('||substr('8001434444',1,3)||')'||
  2         substr('8001434444',4,3)||'-'||substr('8001434444',7,4) phone
  3    from dual;
PHONE
(800)143-4444
SQL>

Similar Messages

  • Formatting phone number: how to get rid of (...)?

    I live in Romania, and Contacts incorrectly formats phone numbers of the type xxxx xxx xxx (10 digit, the national standard, out of which the first is zero) into (xxxx) xxx xxx, i.e. inserting brackets before the first and after the 4th digit respectively. This is wrong. The bug is seemingly banal, yet it has bad consequences: if phone numbers are exported to Android, some Android devices, not all, alas, cannot dial such numbers and the process is stopped. Well, this may be a bug in Android, nevertheless the problem exists.
    A workaround is to choose another country as standard, e.g. Czech Republic. It works, but only for numbers added from that/this moment on, it does not remove (...) from the existing numbers.
    Q: how can I remove those stupid brackets (....) from the existing phone numbers? I need a global solution, a script or something...
    I reported the issue to Cupertino but they seem to be extremely slow, I do not understand why. Those brackets are incorrectly inserted, the national standards specifies a 10-digit number, out of which the first is zero, which is removed in case of international calls, and the prefix is added.

    Self answer: I changed country at hazard to Czech Republic, and all the phone numbers have been meanwhile changed from the wrong format (xxxx) xxx xxx to the correct format 0 xxx xxx xxx
    Praise be to hazard settings.
    P.S. Yes, I marked myself with a green bingo.

  • Custom field to format phone number?

    Is it possible to create a custom field for a list item to format a phone number (e.g. take 555-555-5555 and format it to (555) 555-5555)?  Does anyone have any examples?

    Hi,
    If you want to format the phone number to (555)555-5555, you can create a calculated column base on the phone number column and set its formula as” ="("&REPLACE([phone number],4,1,")")” .
    For more information about formula, please refer to: http://office.microsoft.com/en-us/sharepointtechnology/CH100650061033.aspx
    Hope it can help you.
    Xue-Mei Chang

  • CS3, PHP, Javascript: Auto-formatting phone number pre-post

    Hi guys and gals, I'm creating a simple user registration form, with a text field to have the user enter their phone number (this should autocorrect as the user types it). Grabbed a javascript snippet online, and I see whats going on in the code, but for some reason, its no workey
    Have 3 parts to the webpage, these are:
    The Javascript: "includes/ValidatePhone.js"
    // JavaScript Document
    <SCRIPT LANGUAGE="JavaScript">
    var n;
    var p;
    var p1;
    function ValidatePhone(){
    p=p1.value
    if(p.length==3){
         //d10=p.indexOf('(')
         pp=p;
         d4=p.indexOf('(')
         d5=p.indexOf(')')
         if(d4==-1){
              pp="("+pp;
         if(d5==-1){
              pp=pp+")";
         //pp="("+pp+")";
         document.form1.number.value="";
         document.form1.number.value=pp;
    if(p.length>3){
         d1=p.indexOf('(')
         d2=p.indexOf(')')
         if (d2==-1){
              l30=p.length;
              p30=p.substring(0,4);
              //alert(p30);
              p30=p30+")"
              p31=p.substring(4,l30);
              pp=p30+p31;
              //alert(p31);
              document.form1.number.value="";
              document.form1.number.value=pp;
    if(p.length>5){
         p11=p.substring(d1+1,d2);
         if(p11.length>3){
         p12=p11;
         l12=p12.length;
         l15=p.length
         //l12=l12-3
         p13=p11.substring(0,3);
         p14=p11.substring(3,l12);
         p15=p.substring(d2+1,l15);
         document.form1.number.value="";
         pp="("+p13+")"+p14+p15;
         document.form1.number.value=pp;
         //obj1.value="";
         //obj1.value=pp;
         l16=p.length;
         p16=p.substring(d2+1,l16);
         l17=p16.length;
         if(l17>3&&p16.indexOf('-')==-1){
              p17=p.substring(d2+1,d2+4);
              p18=p.substring(d2+4,l16);
              p19=p.substring(0,d2+1);
              //alert(p19);
         pp=p19+p17+"-"+p18;
         document.form1.number.value="";
         document.form1.number.value=pp;
         //obj1.value="";
         //obj1.value=pp;
    setTimeout(ValidatePhone,100)
    function getIt(m){
    n=m.name;
    //p1=document.forms[0].elements[n]
    p1=m
    ValidatePhone()
    function testphone(obj1){
    p=obj1.value
    //alert(p)
    p=p.replace("(","")
    p=p.replace(")","")
    p=p.replace("-","")
    p=p.replace("-","")
    //alert(isNaN(p))
    if (isNaN(p)==true){
    alert("Check phone");
    return false;
    </script>
    And then we have the actual PHP Form, "includes/Users_Insert.php":
    <form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" enctype="multipart/form-data">
    <table>
         <th class="WADADataTableHeader">Phone Number:</th>
         <td>
              <input type="text" name="number" id="number" size="32" onclick="javascript:getIt(this)" />
              <?php echo $tNGs->displayFieldHint("number");?>
              <?php echo $tNGs->displayFieldError("Users", "number"); ?>
            </td>
         </tr>
          <tr>
              <td class="WADADataNavButtonCell" nowrap="nowrap">
              <input type="image" name="KT_Insert1" id="KT_Insert1" value="Insert record" src="../WA_DataAssist/images/Pacifica/Refined_insert.gif" />
           </td>
              <td class="WADADataNavButtonCell" nowrap="nowrap"><a href="users.php" title="Cancel">
                   <img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../WA_DataAssist/images/Pacifica/Refined_cancel.gif" /></a></td>
         </tr>     
    </table>
    And here is the calls to put all of that together, "add_user.php":
    <html><head><title></title>
    <script src="includes/ValidatePhone.js" type="text/javascript"></script>
    </head>
    <body>
    <?php include("includes/Users_Insert.php"); ?>
    </body>
    </html>
    (didn't paste the whole website obviously, just the parts that should be relevant).
    Anyone see anything in the code as to why this wouldn't be working as intended?

    You are not telling your form to validate the phone no.
    For a brief description of validating a form see - http://www.w3schools.com/jS/js_form_validation.asp
    Take special notice of - onsubmit="return validate_form(this)"
    PZ

  • Generic funtction  return  format string Phone Number

    Hi
    I tried , tried but nothing
    I need build a Generic Function formating phone number, passing Type Telephone (Res,Cml,Cel...etc wiht 3 letters ) , Prefix can to have 3 or 4 digits and Sufix wih 4 digits
    How Can I to do It ?
    where can I to find tutorial about Regular Expression
    thank

    Asking the same question again?
    Re: Function that to Format
    Look in the documentation for regular expressions (it's not difficult to search you know!)
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_regexp.htm#ADFNS1003

  • Using Adobe Acrobat XI, uploaded my form from my Word. How do I format spaces for SSN, DOB, Phone number?

    I'm trying to create a new client form how do I format the spaces numerically for DOB, SSN and phone number??? HELP! Can I do this on Adobe Acrobat XI????

    Not sure what you mean by uploaded form. Did you print to the Adobe PDF printer, use the Save As Adobe PDF, use Save As PDF or XPS, use the Acrobat menu in WORD, or try to open the word file in Acrobat directly? Assuming you printed to the Adobe PDF printer, then you select the TOOLS>Interactive and select the Form Wizard. Otherwise, you simply use the tools under the interactive menu. You might find the following video useful: http://acrobatusers.com/tutorials/how-to-create-pdf-forms-from-existing-documents. The form tools are under the interactive menu (I could give better direction if I was at home where I have AA XI).

  • E72 - How to format the phone number on contact

    I can't figure out a easy for formatting my contact number to be like (xxx) xxx-xxxx or xxx-xxx-xxxx on e72 instead going to outlook make the changes and re-sync again. I find xxxxxxxxxx hard to read. I thought I found out how to add hypen "ctrl+(" but that basically long dash rather than short dash which you get an error if you try to send message with the phone number having the long dash. It is fine when you call. It is smart enough to strip out non-numerical value. But it is sms is not smart enough to remove it.

    ozidug wrote:
    The sad thing is that there is an international standard for phone numbers (+xxx) xxx-xxxx which everyone ought to recognise and use. It allows localisation and shortened dialling, but Nokia just want a number string. It's just lazy on thepart of the programmers; since it's a standard, they should have developed the program code once and just inserted it into every phone they produce, and that's not hard.
    A poor reflection on Nokia, I'm sad to say.
    AFAIK the international standard for telephone numbers (E.164) does not say anything about using spaces, dashes, or brackets in a telephone number.
    This may of course make it more "human readable", but claiming that what you want is a standard doesn't make it a standard, and I don't think Nokia (or any other phone manufacturer) should/could implement every single user-specific wish...

  • ICloud you have the ability to NOT format phone numbers of contacts; this ability is not available on the contacts of iPhone. If I set-up a phone number in iCloud with NO parenthesis, ex. 123- 456-7899, then this format should be available on the iPhone

    In iCloud you have the ability to NOT format phone numbers of contacts; this ability is not available on the contacts of iPhone. If I set-up a phone number in iCloud with NO parenthesis, ex. 123- 456-7899, then this format should be available on the iPhone contact.

    That is correct is doesn't. Standardized formatting of phone numbers in the iOS app is more important because it supports contact from a variety of locations (gmail, hotmail, etc.). iCloud doesn't (not directly).

  • Help: Enforce phone number format through DB trigger

    Hi,
    I am trying to create a trigger in DB that will alter any phone number insert or update into a standard format as (xxx) xxx-xxxx.
    For example,
    1. if user attempts to insert 123-456-7890, the trigger will alter it as (123) 456-7890
    2. if user attempts to insert 1234567890, the trigger will alter it as (123) 456-7890
    Any suggestions?
    Thank you in advance.
    Jimmy

    SQL> create table test_phonenumber (id number, phone_number varchar2(14));
    Table created.
    SQL> create or replace trigger test_number_trg
      2  before insert or update on test_phonenumber
      3  for each row
      4  begin
      5     if translate(:new.phone_number, '0123456789()-', '9999999999XYZ') = 'X999Y 999Z9999' then
      6             dbms_output.put_line('Good Format -- Row inserted/updated!');
      7     else
      8             :new.phone_number := translate(:new.phone_number, '0123456789-() ', '0123456789');
      9             :new.phone_number := '('||substr(:new.phone_number,1,3)||') '||substr(:new.phone_number,4,3)||
    '-'||substr(:new.phone_number,7,4);
    10             dbms_output.put_line('Phone number reformatted!');
    11     end if;
    12  end;
    13  /
    Trigger created.
    SQL> insert into test_phonenumber values (1, '(123) 456-7890');
    Good Format -- Row inserted/updated!
    1 row created.
    SQL> insert into test_phonenumber values (2, '0019991234');
    Phone number reformatted!
    1 row created.
    SQL> select * from test_phonenumber;
            ID PHONE_NUMBER
             1 (123) 456-7890
             2 (001) 999-1234
    SQL> update test_phonenumber set phone_number = '1117770011'
      2  where id = 2;
    Phone number reformatted!
    1 row updated.
    SQL> select * from test_phonenumber;
            ID PHONE_NUMBER
             1 (123) 456-7890
             2 (111) 777-0011
    SQL>

  • Phone number format edit

    Hello everyone, i have a problem with my iPhone 4S. I'm from Romania so it's not a verizon problem only... When a person in my contact list is calling me it only shows the numer of the caller not the ID, but after i hang-up and go to call history it shows the ID. I tried to put +4 in front of the number but now when someone is calling it shows the ID but in call history it shows the phone number. The phone is Jailbroken so if there is any solution what requires a jailbroken phone i am happy to try it out. The format region is on Romania and the International Assist is OFF. I tried as many things i could find on the internet about this but still can't figure it out. Can you guys help me? My firmware is 5.1.1 and i DON'T want to upgrade to 6 because i use a gevey sim card to unlock it, so anything else that can help ?

    Thanks, indeed. I had my Phone language set to "English (United States)" . I never thought that this would change the number format. I changed it to English and now it's ok.
    + it stopped with that annoying correction while i'm writing text.
    So double thanks
    Attachments:
    wp_ss_20130524_0002.jpg ‏71 KB

  • Luxembourg phone number formatting in iOS = 4.0

    Hello,
    Since upgrading to iOS 4, phone numbers here in Luxembourg are no longer displayed in a readable way, the formatting is incorrect.
    Example : the correct phone number 26 52 26 52 would be displayed as 2 652 2652. That's bizarre, not logical and not readable. The first digit is not a prefix, it makes no sense at all to group phone numbers as # ### ####. You could show it in blocks of 2 or 4 (3 would be a bad choice because numbers are usually 6 or 8 digits).
    Is this a know bug ? In MacOS you can define your own number formats in the address book, but that's obviously not possible in the iPhone.
    Pascal

    Yes, Region Format is set to Luxembourg. Language is set to English. I should have mentioned that my wife and my friends have exactly the same issue with their iPhones.
    Pascal

  • Phone number display format

    We are looking for a way to personalize the display format of phone number.
    I am at a company where there is a SAPphone or alike software connection to auto-dail using the SAP screen. Other then most companies here this is done from ECC rather then from CRM.
    For this, the Phone numbers are stored flat, without spaces, hashes and the like.
    In SAP there are setting for how to display date and numbers. I did not yet find a way to do the same with phonenumbers. There is an international requirement on how to display the numbers, and storing these numbers formatted is in my opinion not the preferred way to do it.
    There are function modules to format the numbers from flat stored numbers, but that will mean cloning standard transactions to Z versions so that the FM can be used. I would rather not do this too.
    Anyone any ideas?

    I am having the same issue with My Treo 700.  Did anyone find a resolution to this problem.  I think it is more than annoying.  For no reason the formatting just changed. 
    Thanks for you help.

  • How to create an item Phone Number of US Format

    Hi,
    Need to create an item in a page Phone Number.
    The Item should accept only US Phone Number Format.
    Need Suggestions.
    Regards,
    Krishna

    Hi Krishna,
    You can make the US Phone format validation in the Page controller by making a validation function and call this validation function on the submit button or form submission. u can use the following function in the page controller-
    public void validatePhone(String sPhoneNumber )
    Pattern pattern = Pattern.compile("\\d{3}-\\d{3}-\\d{4}");
    Matcher matcher = pattern.matcher(sPhoneNumber);
    if (matcher.matches()) {
    throw new OAException("Phone Number Valid", OAException.INFORMATION);
    else
    throw new OAException("Phone Number must be in the form XXX-XXX-XXXX", OAException.INFORMATION);
    and call the validation function in processFormRequest function
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAMessageTextInputBean msgInBean =(OAMessageTextInputBean)webBean.findIndexedChildRecursive("<id of the element>");
    if ((pageContext.getParameter("<submit button>") != null))
    String val =(String)msgInBean.getValue(pageContext);
    validatePhone(val);
    u also have the following imports in the controller -
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    I hope this will help u.
    Regards
    Renu

  • Cannot activate my itunes account, it does not recognize any entry format for my phone number.

    this happens when i try to download an app on my new iPad, iTunes requires me to fill out an online form but when enetring the phone number, iTunes doesn`t recognize any entry format.

    In most locations your Apple ID is a valid email address. Did you try entering you most used email address?

  • 10 digit phone number format

    Does anyone know of a way to change the default BB 10-digit phone number format of NNNNNNNNNN to include either spaces or parentheses?  i.e. (NNN) NNN-NNNN or NNN NNN NNNN.   

    Hi and welcome to the forums.
    If you setup your contact in the (722-344-66770 you can certainly do it. The field is numeric..
    You can view the contact and it will be that format, but when you dial, it will just be numbers, The telco has no need of the dashes and parenthesis so the BB doesn't waste space displaying and sending them.
    The dashes and () in this case mean nothing to the telco. There are symbols that do, but if you stay with these your safe.
    If you need further assistance please ask! If not:
    Please resolve the post using the green kudo's box. Simply check the post that had
    your answer in it. Thanks!
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

Maybe you are looking for

  • Kuler not syncing colors properly between web and CC apps?

    I just created a new Kuler theme on the web ("Lyft app basics"), and then synced with Illustrator CC (running 17.0.0). For some reason, the theme color values are not showing up properly! I had created a theme a few weeks ago ("dark cocktail bar") an

  • Finding Last Successful Request of an Object

    Hi Expert's,     Can someone guide me Steps to find the last succesful transport request for a particular object which is succesfully moved from one system to another( i.e, Developement to Production)

  • Oracle Projects - data upload from excell

    Dear Experts, Currently we are in the process of  implementing oracle R12.1.3  .   Consultants  are in the stage of BRD requirement analysis. Projects  billing, costing, management and service contract. Here  as per our business requirement, we need

  • Update Inbound Idoc field.

    Hello All, I am trying to send a idoc thru FIDCC1 thru ALE. I want Local currency and Group currency value to be recalculated in Target system before it gets posted in the target system based on a custom table(Source system is sending only document c

  • Problems printing Acrobat documents on shared printer

    I have a MacBook Pro and a Mac Pro. I also have an Epson 1400 printer. When I print any Acrobat document using the printer hooked up directly to my MacBook, it prints perfectly. When I print the same Acrobat document using the printer hooked up direc