phone number format (999-999-9999)

Hello

I want to 999-999-9999 number phone this format, under query works correctly, but I want to without using how to get this.

Select regexp_replace (lpad (67890,10, '0'),'(.{3}) (. {3})(.{4})', '\1-\2-\3') of double;

output: 000-006-7890

can anyone suggest me.

Thank you

Otherwise use? LPAD? REGEXP? Anyway, you can use to_char:

Select double to_char(67890,'FM000G000G0000',Q'[nls_numeric_characters='.-']')

/

TO_CHAR (67890
-------------
000-006-7890

SQL >

SY.

Tags: Database

Similar Questions

  • TO_char error - number mask format - need phone number format

    Hi all

    I got a stuck in something fundamental. my contribution will be number (say 1 to 9999999999) I want to be filled in this format (999-999-9999). I tried the sub query, it does not help me.

    Select double to_char(1234567890,'999-999-9999');

    Please tell me which function is more suitable for this.


    my entry can be a single digit also, but my output should be ten-digit (ie: if I gave 1, o/p should be 000-000-0001)

    kindly help me.

    Thank you
    Jeevanand.K

    Try something like this:

    sql> select to_char(1234567890,'000G000G0000', 'nls_numeric_characters=''.-''') from dual;
    
    TO_CHAR(12345
    -------------
     123-456-7890
    
  • Phone number format

    Hi team,

    need your help, I am using oracle 11G.

    My phone field is of type varchar2 and it shows data on format below.

    81668798343000000000000

    I wanted to remove unwanted zeros.

    result should be 816687983430

    Please help me out here

    Hello

    siebelD kirjoitti:

    Hi team,

    need your help, I am using oracle 11G.

    My phone field is of type varchar2 and it shows data on format below.

    81668798343000000000000

    I wanted to remove unwanted zeros.

    result should be 816687983430

    Please help me out here

    No, you don't say what the rules involved in this area. Otherwise it's hard to know that a zero belong to a phone number and rest zeros does not work.

    I guess the length of phone number is 12

    Select substr ('81668798343000000000000', 1, 12) of double

  • How to get the number in the format "999,999,999.000" in oracle

    Hi friends,
    How can I get the number entered in the format '999,999,999.000 '...
    for example, if my number has 1900, it should give 1,900.000
    If my number is 10000, then it should give me 10,000.000 like this in sql
    is there a function available for this?

    pls help

    Thank you

    Hello

    Check below hope it solves your problem.

    SQL> SELECT TRIM(TO_CHAR(1900, '999,999,999,999,999.99')) FROM DUAL;
    
    TRIM(TO_CHAR(1900,'999,999,999
    ------------------------------
    1,900.00
    SQL> SELECT TRIM(TO_CHAR(10000, '999,999,999,999,999.99')) FROM DUAL;
    
    TRIM(TO_CHAR(10000,'999,999,99
    ------------------------------
    10,000.00
    
    SQL> 
    

    Concerning
    Ameya

  • Display the format US phone number - best practices

    JDeveloper 12.1.3

    -Telephone table has field VARCHAR2 with phone numbers. All records have exactly 10 numbers (characters) length

    -In the user interface, I want to show number xxx-xxx-xxxx, that is to say with af:outputText or similar device

    -observe that I am looking for display, and no to entry/edit phone number

    -in search of best practices

    What I did but am not satisfied:

    -In the t 3 has created a transitional attributes with the default SQL string. For example:

    Phone1To3: substr (Phones.Phone, 1, 3)

    Phone4To6: substr (Phones.Phone, 4, 3)

    Phone7To10: substr (Phones.Phone, 7, 4)

    Then in file jsff (the table component):

    <af:outputText value="#{row.Phone1To3}-#{row.Phone4To6}-#{row.Phone7To10}" shortDesc="#{bindings.Phones.hints.Phone.tooltip}" id="ot2222"/>
    

    Another way (better, easier)?

    In my view, that the best practice is to do your own converter in this case you will not need transitional attributes as you did. After doing a converter, you can add this converter inside outputText inputText. .. to display the required format

    To find out how a converter, you can check this url

    Sameh Nassar: Create custom converter

  • format phone number

    I need to format the phone number in a column of table as phone_number to

    (+ 1-888-888-8888) to (888)888-8888


    y at - it a function or query in oracle for this.  Help is appreciated

    SQL> with t
      2  as
      3  (
      4  select '(+1-888-888-8888)' phone_no from dual union all
      5  select '888888-8888' phone_no from dual union all
      6  select '+1-888-888-8888' phone_no from dual union all
      7  select '1232341233' phone_no from dual
      8  )
      9  select phone_no
     10       , '(' || substr(phone_no_digit, 1, 3) || ')' || substr(phone_no_digit, 4, 3) || '-' || substr(phone_no_digit, 7) phone_no_new
     11    from (
     12          select phone_no
     13               , substr(regexp_replace(phone_no, '[^[:digit:]]'), -10) phone_no_digit
     14            from t
     15         );
    
    PHONE_NO             PHONE_NO_NEW
    -------------------- --------------------
    (+1-888-888-8888)    (888)888-8888
    888888-8888          (888)888-8888
    +1-888-888-8888      (888)888-8888
    1232341233           (123)234-1233
    
    SQL>
    
  • Validate / Format of phone number with Extension

    I am trying to allow users to enter a phone number, with the POSSIBILITY of adding an extension at the end, but I can't seem to get the good coding...

    Thus, users should be able to type the following:

    5555555555

    555-555-5555.

    (555)555-5555

    555-555-5555

    As well as

    55555555551234

    1234 5555555555

    555 555 5555 1234

    555-555-5555 1234

    And they should all validate/format:

    555-555-5555 ext (number of optional expansion)

    5 years and 1234 s are only examples.

    I tried to use a mask of arbitrary, but you are unable to view OPTIONAL characters method... they want to all be necessary therefor 9999999999 ext9999 eventually REQUIRE a 4-digit extension.

    Thanks in advnace for your help

    It can be done using a custom size validation script.

  • Remove formatting phone number?

    I have a form in which a user enters his phone number and I need another field to fill the numbers without any formatting. For example, if a user enters 555-232-4455 it would appear in the new domain as 5552324455. I guess it could be a script made in the field of origin on the blur, but I don't know the best way to do it. Any suggestions? Thank you!

    In the second field, you can use this custom code as the calcluation script:

    Event.Value = this.getField ("Phone No").valueAsString.replace(/\D/g,"" ");

  • Phone number in html format

    My problem is related to the recognition of phone number in the Blackberry browser: I have created a simple webpage using html and displays the numbers as 07811987654
    I need to click on it and call the phone call

    07811987654

  • Phone number fields

    Hello

    I have my phone set up number fields so that when the user enters a 10-digit phone number, they tab above and it appears as such: (999) 999-9999. I was wondering if there is a script that can be used to allow only the codes 204 and 431.

    Thank you in advance for any help you can give me.

    NikDk

    Form1.Page1.Subform1.telephone::exit - (JavaScript, client)

    validat formats include 1234567890, (123)456-7890 and (123) 456-7890

    var regex = / ^-(?) () \d{3})\) ? [- ]? ({\d{3}) [- ]? (\d{4})$/;

    var str = this.rawValue;

    If (regex.test (str)) {}

    var areaCode = "";

    Regex = / ^ \d{10}$/;

    If (regex.test (str)) {}

    the format is 1234567890

    codeZone = str.substring (0.3);

    If (ZipCode == '204' | codeZone == "431") {}

    "Str =" ("+ str.substring (0.3) +" "") "" + str.substring (3.6) + '-' + str.substring (6.10);

    this.rawValue = str;

    }

    else {}

    xfa.host.messageBox ("the area code must be either 204 or 431.");

    }

    }

    else {}

    the format is (123)456-7890 or (123) 456-7890

    codeZone = str.substring (1.4);

    If (ZipCode == '204' | codeZone == "431") {}

    this.rawValue = str;

    }

    else {}

    xfa.host.messageBox ("the area code must be either 204 or 431.");

    }

    }

    }

    else {}

    xfa.host.messageBox ("Please enter the 1234567890 format phone number, (123)456-7890 or (123) 456-7890" ");

    }

    Steve
  • Set the focus on the phone number field when validation fails

    Hello

    I have a text field set up like a field of phone number, with the following text in the change event to accept only numbers:

    if(xfa.event.newText.match(/[^0-9]/)){
    xfa.event.change = "";
    }
    

    The validation of the model, I have this mask on all tabs (display, editing, Validation and data):

    Text {'('999') ' 999-9999}

    I want the user to be able to just enter numbers and have the parentheses and added automatically dash ["123-456-7890"].


    How the focus to stay on the field when it is not validated? (e.g., insufficient or too many digits).  I have looked at validationState , but couldn't find out how to use it (I am a javascripter noob).

    Thanks for any help.

    in the case of output of your domain:

    if (this.rawValue.length !=9) xfa.host.setFocus(this);
    
  • Custom number format function does not return 0 in decimal form

    Hello

    My custom number formatting feature does not work. It was working fine when the site has a standard client server architecture. However, when we changed using the REST API with javascript and HTML 5 function works for most except in cases when I need it displays 0 for decimal numbers.

    Basically, the function accepts arguments a number and the number of decimals and returns the number rounded the number of decimals. Below, I've stripped naked function minimum, even I was testing.

    < cffunction = "dispCostPeriod" access = "remote" returntype = "string" output = "false" hint = "name costs for a specified period at the user" >

    < name cfargument = "in_decCost" type = "numeric" required = "yes" / >

    < name cfargument = "in_iRound" type = "numeric" required = "yes" / >

    < cfset decRoundedNum = NumberFormat (in_decCost, "_" & RepeatString("9",in_iRound)) >

    < cfreturn decRoundedNum / >

    < / cffunction >

    When I pass 55.00089 and 3, the function returns 55.001.

    When I was 55 or 55.000000 or 55.0000089 and 3, the function returns 55

    . And I need to 55,000.

    I tried both for returntype 'string' and 'digital', various masks as _.999, _.000, _. ___.

    I tried NumberFormat (in_decCost, "_.000") straight back.

    Nothing works.

    I use CF10 on Windows Server 2008.

    Any help much appreciated.

    Thank you

    Gena

    Can you explain how the data gets into the browser as a JSON string format?

  • All excel cell number format using "excel cell format.vi set.

    Hi all

    I am writng 12 numbers to Excel cell, but it seems to me that 2.00207E + 11 instead of 200207106040. I use entire excel function cell phone format.vi but it is not useful, because I have no number format...

    Reference in the image file setting a VI.

    Thank you

    Got the answer.

  • How to make a 'active' phone number in the text box?

    I'm testing in 10.1 and 10.2, using the following QML simulators.  What I'm trying to understand is that 'rules' the text box used to set the active text, including phone numbers.  All I'm trying to do is to put a phone number in the text box that my users the opportunity to click on it to the phone.  But I can't make it work, or more exactly, may not get the phone number to become active.  .

    As you can see that I tried a variety of number formats, some specific UK because I was afraid that he may use country specific recognition, but nothing I try works.

    On the other hand the address which I also put in the TextArea is 'hot' and started the map.

    FYI, the client is running in Canada on Q10s using 10.1.  The numbers are also completely fictitious, if they work, then that is a stroke of luck.

                    TextArea {
                        inputMode: TextAreaInputMode.Text
                        editable: false
                        content.flags: TextContentFlag.ActiveText
                        text: "#123 1234, #123-1234  ph: 780-784-1231. ph: (403)218-1248. ph: 403-242-1231. ph: (01637)123456. 81 Street NE, # 101 ,, Calgary. "
                    }
    

    I saw this:

    http://supportforums.BlackBerry.com/T5/native-development/textarea-showing-quot-phone-numbers-quot/m...

    I was expecting that I didn't set the attributes for the text using C box.

    And I don't have permissions phone - eslewhere in the application that I detect when the user is on the phone.

    Any ideas on how I could get a phone number in a TextArea to be active, would be appreciated.

    Well, for what it's worth here's what I get with your data :

  • getDevicePhoneNumber() provides the phone number with the unicode left-to-right mark

    I use getDevicePhoneNumber (boolean format) ( http://www.blackberry.com/developers/docs/4.6.0api/net/rim/blackberry/api/phone/Phone.html#getDevice... (boolean)) to get the telephone number of my camera. I know that maybe it's not the actual number. I also can't use something else as the pin of the device. I use it to fill a field "my phone number" by default that can be edited manually in the case where the number is not correctly being read on the SIM card.

    It works really well and displays the phone number in the field. However, a thorough review to the string of shows that he has the mark unicode '% E2% 80% 8F' in front of the string. This brand is known in unicode (utf-8) "BRAND LEFT-to-RIGHT ' (sources: http://www.tachyonsoft.com/uc0020.htm and http://unicode-search.net/unicode-namesearch.pl?term=mark ).

    I only experienced it in BB OS 4.6 devices (does not check 4.7 yet), but it seems not to happen in OS 4.5 and below.

    Were there changes to the orientation of the chain in OS 4.6?

    Can I get rid of this brand using String.trim (); or I have to use something else?

    This problem persists on my 9000 "BOLD", but none of my other GPS phones.

    Because it was a pain to try to understand, here's the code I used to solve this problem.

    private String trimPhoneNumber(String phoneNumber){
        byte phoneBytes[] = phoneNumber.getBytes();
        int length = phoneNumber.length();
        int offset = 0;
        if ( phoneBytes[0] == 0x3F ) {
            length--;
            offset++;
        }
    
        return new String(phoneBytes, offset, length);
    }
    

Maybe you are looking for

  • help with email, it could be a "PARODY."

    Hi I have an email he says his Apple? Dear please confirm your order? What a joke, I didn't order anything how to recognize a fake email thank you all I am new

  • Crook

    Be on the lookout for people using the identity of the American army officers in an attempt to scam the only women of their money. I received a request to contact a general Martin Dempsey. I was curious to know why an American army general would cont

  • set custom print page margins

    I tried searching the forum for defined automatically custom page margins, but I see none, so I would like to know if it is possible to do... The reason why I want to do is because my program call for PDFCreator printer print automatically, and if it

  • No sound. Assistant support said HP idt high definition audio codec ERROR 52

    Laptop HP Pavilion G7-1273NR Windows 7 64 bit Error of IDT High Definition Audio CODEC 52 Windows says "No. Audio Output Device is Found. Everything worked fine last night.  This morning he has no sound. I guess I have an audio driver damaged (corrup

  • I'm not a developer. I need Net framework

    I'm running out of disk space.  NET Framework has been installed several years ago, and I can't determine if nothing else I use needs this program.