Insert hyphen after the first two digits

I don't see just how I can insert the hyphen in one of my filed talbe. for example I have 123456789, 321654987 I want just to add the hyphen after the first two digits. 12-3456789, 32-1654987. Do I need an update statement to change that in my talbe. Thank you

Of course, the column is VARCHAR2, then

UPDATE t
   SET a = SUBSTR( a, 1, 2 ) || '-' || SUBSTR( a, 3 );

Or you can leave it as it is and create a new view on the table in the format of the string you want.
Or you can just format the selection of the table.
Or you can add a virtual column with data formatted as you wish.

All depends on your needs.

Tags: Database

Similar Questions

  • List of files in numerical order after the first two digits

    I have scanned documents on a usb key & saved as pdf files using a 8-digit date.  When I go to open the files, they are only in the order for the 2 first digits.  How can I get adobe to put in order using all 8 digits so that they are listed in chronological order, including the day and year?

    Adobe not in numeric order question.png

    The operating system will not sort by date like this. If you look at, it IS the 'digitally' sort 'dates' are in numerical order from the smallest to the largest.
    What I'm doing to sort by date is to use this format "YYYYMMDD".

  • values based on the following logic 'values after the first values of two '_' and before last '_' values '.

    Hi all

    I need the values according to below 2logics in a single select query using instring and substring

    1 values based on the following logic 'values after the first values of two '_' and before last '_' values '.

    2 values based on the following logic 'values after the first values of two '_' and before last'-'values '.

    EXM:

    Entry: ABCD_EFGH_IJKLM - NOPQ_XYZ output: IJKLM - NOPQ

    Entry:. ABCD_EFGH_IJKLM - NOPQ output:IJKLM

    Thank you.

    Check the following

    WITH DATA1 AS

    (SELECT "ABCD_EFGH_IJKLM - NOPQ_XYZ" double val)

    UNION ALL

    SELECT 'ABCD_EFGH_IJKLM - NOPQ' double val

    )

    SELECT SUBSTR (VAL, INSTR(VAL,'_',1,2) + 1, DECODE (BIGGER (INSTR (VAL, '_',-1, 1), INSTR(VAL,'-',-1,1)), INSTR (VAL,'-', - 1, 1), LENGTH (VAL) + 1, INSTR (VAL, '_',-1, 1))-(INSTR (VAL, '_', 1, 2) + 1))

    OF DATA1;

    Concerning

    Salim

  • Hello, I currently have 3 subscribers: 1) first 2) effects after 3) package for a student in the acquisition of switching on all the programs. Can unsubscribe the first two presentations, namely, I want to unsubscribe from the Adobe Premiere and Adobe bac

    Hello, currently I have 3 subscribers: 1) first 2) effects after 3) package for a student in the acquisition of switching on all the programs. Can unsubscribe the first two presentations, namely, I want to unsubscribe from the first and Adobe Adobe after effect.  user: [email protected]

    Hello Anton

    I checked your account and see that you had a first CC, After Effects CC & a full subscription of creative cloud.

    I cancelled the subscription Premiere and After Effects for you.

    Let me know if you need assistance.

    Thank you

    Scott

    Follow us on Twitter @AdobeCare

  • Oracle sql for data after the first occurrence of the hyphen

    Hi, I need oracle sql get data after the first occurrence of the hyphen.

    source of the string:
    ABCD - efgh

    I just want everything after the ' - '.

    someone help me please...

    Edited by: 1001076 on 28 may 2013 18:42

    Handle: 1001076
    Status level: Beginner
    Join date: April 18, 2013
    Messages total: 12
    Total Questions: 4 (3 pending)

    I offer you my condolences; Since you rarely get your questions answered here.

  • How to disable the button after the first click (click multiple problem)

    Hello

    I have a ' create' button related to processes of insertion in the database view. The problem is that when I click on him twice, I have two insertion in my database (even with the option run processes: "Once a visit to Page"). Is it possible to disable the button after the first click? and activate on load before the header?
    or maybe there's better solution? I thought that the process of the option run must stop multiples (insertion).

    Przemek

    Przemek:

    You can do the following.
    (1) set the "button"style"of the 'Create' button to be 'Button HTML'"
    (2) set the "key Attributes" have
    ID = "myButton".
    (3) in the "optional Redirect URL" section set to 'Target' ' "URL".
    (4) for the URL, specify {code}
    JavaScript: $x('myButton').disabled = true; doSubmit ('CREATE') {code}

    CITY

  • Firefox does not open a link after the first; Open ok in new tab front.

    In the last week or two, for reasons not clear to me, Firefox does not open the new links after the first; It is used to open a new connection in new tabs (according to my preference) without problems in the past. Now it does not blink again.

    Over time, I've added new applications and others removed, and, of course, I can't exclude from their role in the problem that I have now. I would appreciate some help to solve this problem.

    You have this problem when running in Firefox SafeMode?

    http://support.Mozilla.com/en-us/KB/safe+mode

    Do not choose anything at the moment, just use 'continue in safe mode.

    If this is not the case, see this:

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+theme...

  • Windows 7 Pro 64-bit not start after the first update.

    Integrated system:

    Motherboard: Version of the BIOS Gigabyte GA-X58A-UD3R revision 2.0: FA

    CPU: Intel Core i7-930

    Memory: 6 GB Corsair PC3-12800 DDR3 Triple channel

    HD: Western Digital Black 500 GB SATA 3 Gb/s

    Water cooler: Corsair H50

    The operating system has been installed and running perfect. Readers for the mobo has been installed and and all is well. I can see everything on my computer, network, disks, programs, Device Manager and etc.

    First update for the system, only the important updates were downloaded and after the reboot, the system will not start. The system to start repairing the system but found no problem and restart again and return to the screen of system repair.

    The operating system has been installed 5 times and I had the same problem after the first update, the system unbootable. I tried to boot from the Windows dvd, but I had the same problem again.

    Can someone help me with this problem?

    Thank you

    M. Vilela

    Hi Danielle,

    In addition to the suggestion of Rock Star, you can try the following steps and check if it helps.

    Step 1

    You can first try to start the computer in safe mode and check if you can boot to the desktop. Access the link below and follow the steps to boot to the desktop. To boot to the desktop in safe mode keep tapping key F8 during restart. Once you see the option to start in safe mode select and press to enter.

    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode

    Step 2

    If you are able to boot to the desktop in safe mode, you can access to view the history of update on your computer and search for the error code and the updates that failed to install and post it back.

    To view the update history, follow the steps below:

    A. open the control panel (all items view) and click the Windows Update icon.

    B. click on the link to view update history.

    To view the details of a single Windows Update. Select and right-click on a Windows Update list, and then click details.

    Step 3

    I would say also allows you to perform a system restore in safe mode to see if you can restore the computer to an earlier date when it was working fine.

    To restore the operating system to an earlier point in time, follow these steps:

    a. Click Start, type system restore in the search box and then in the list click on the system restore program.

    If you are prompted for an administrator password or a confirmation, type your password or click on continue.

    b. in the System Restore dialog box, click on choose a different restore point and then click Next.

    c. in the list of restore points, click a restore point created before you started having the problem, and then click Next.

    d. click Finish.

    The computer restarts and system files and settings are back to the State they were in when the restore point was created.

    Access the link below to learn more about how to repair the operating system and how torestore configuring operatingsystem to a point in time earlier in Windows:

    http://Windows.Microsoft.com/en-us/Windows7/what-is-system-restore

    I hope this helps. Let us know the results.

    Thank you and best regards,

    Srinivas R

    Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I've lost the last two digits of my valid key for xp pro sp2 and notebook, how do I get the key and support? where?

    I've lost the last two digits of my valid key for xp pro sp2 and notebook, how do I get the key and support? where?

    Hi Jonathan,.

    Please go to the Microsoft Community Forums.
    After the description of the question, I understand that you have lost the last 2 digits of the product key.
    Let me go ahead and help you with the issue.
     
    Please answer these questions, which will help us to help you best.
    1. How did you get the product key?
    2. the operating system come preinstalled on the computer?
     
    I suggest you for the link and check if that helps:
    How to identify, locate, and replace a product key
     
    See also:

    I hope this helps. If you have any other queries/issues related to Windows, write us and we will be happy to help you further.
  • Successive connection LDAP fails after the first LDAP authorization: with wrong password

    Hello

    I am currently integration Oracle CC & B utility to LDAP (Sun Directory Server java - SunOne), but I made a post here because CC & B delegates the task of authentication to the server Weblogic (I user WLS version 10).

    In Weblogic, I configured two authentication providers:
    1. the principal is the LDAP authentication provider (defined as optional control indicator)
    2. secondary education is the default authentication provider (defined as optional control indicator)

    Currently, some users of CC & B are stored in LDAP, and some other (more users system) are stored in the default authentication provider.

    To help you make the problem more clear, I did the test with followingscenario:
    1. user LDUser2 (stored in LDAP) login with correct passwrod-> success
    2. the sysuser user (stored in the default authentication provider) connect with incorrect password-> access denied (what is good and normal)
    3. the LDUser2 (stored in LDAP) user login with password-> successful OK
    4. the sysuser user (stored in the default authentication provider) connect with correct password-> successful OK
    5. the user (stored in LDAP) LDUser2 connect with the incorrect password-> denied access, which is normal. However, from this point, the problem starts
    6. the user (stored in LDAP) LDUser2 connect with the right password-> rejected access KO is the problem
    7. connection (also stored in LDAP as LDUser2) LDUser1 with the right password of the user-> big problem of access denied KO
    8. the LDUser7 user (stored in the default authentication provider) connect with the right password-> successful access
    9 restart the server resets the situation, but once a user is stored in the LDAP connection with a wrong password (5 point number), attempts by users stored in LDAP fail.

    It seems that after the first LDAP authentication with wrong password, all users stored in LDAP connection attempts will fail.

    Help, please.
    Thank you.

    Jeffry

    Hello

    The connection attempt is made on console weblogic with the same result?

    If I'm not wrong, until WLS 10.3 it is a problem reported where once the user connects with password and username incorrect, all attempts after that results in the failure of the connection.

    The patch is available with up to 10.3 WLS support

    This might be the question however need to check.

  • Comparing the first four digits

    Hello


    I need to compare two different tables say account numbers a and b



    I need to select the first four digits of the account number of 'b' and which correspond with the first four digits 'a'



    for example in b if I have the account number from - 1234

    I need to select all the account numbers from a starting with 1234 - like 1234567, 1234789etc.,.


    Please help me

    Hello

    Account numbers are really numbers and not the chains?
    If the two numbers have different lengths (e.g. 1234567 and 1234) do you always want to compare the first four digits?

    Assuming that the answers to both is "Yes":

    ...
    WHERE   SUBSTR (TO_CHAR (a.account_number), 1, 4) =
            SUBSTR (TO_CHAR (b.account_number), 1, 4)
    

    If the account_numbers are really chains, omit TO_CHAR.

  • I recently changed my IE but when I try to import the Favorites I get only the first two files. How can I get my favorite of all THE? s

    I followed the advice and imported IE Favorites, but only the first two files have met. How can I get all THE files across please?

    Wow. I think I will like Firefox if the aid is so easily available, quick and as good as this. Fixed right away
    Thank you very much
    Kevod

  • iPhone5 only showing the first 8 digits of the wi - fi address

    Address wi - fi is only showing the first 8 digits, then... How do I access the other 4?  Even when I turn the phone on its side for more space it does not when you view the settings screen.  I try to connect to a secure wireless network and may not without the entire address.  Any help appreciated.

    I go in settings/general/to say and it displays all my WiFi address. Yours does not work?

  • How to pass data to the tables according to the value of the first 4 digits of 7 strings of numbers

    I want to sort incoming data, in several bays based only on the first 4 digits of each string.

    For example, a hexadecimal string may be 41322033333533 which is A1 3353.

    A1 is a sensor. particularly, and I want to send all data from the A1 to a table. I have 8 sensors data and want to send the data to separate the bays of sensor. My sensor names are A1, A2, A3, T1, T2, T3, W1

    I will use a structure of the matter, for loop and a comparison of '=' for the data. However, I want to only compare the first 4 digits of the string and I can't find an operator for this. Any advice on how to proceed would be appreciated.

    With a thread like this

  • wait and trigger the first incoming digital dashboard

    Maybe it's a frequently asked question, but I managed to understand the trigger DAQmx VI. Is the trigger VI supposed to block the program until Gets an edge? It waits indefinitely?

    A screenshot of my failed attempt is attached to this message. I want to start my measurement (HAVE several channels) to the first incoming digital edge (or increment of the counter) on a system time real PXI. Before entering the loop of measure I want to wait for an edge (possibly indefinitely). Inside this loop, I want to begin to acquire the data values and counter of I.

    I even tried to use the example, but I get an error of dialog (see screenshot).

    Hello pgraebel,

    The trigger VI just configures the behavior of the acquisition.  So, once the start VI task is called, the task itself will be armed and waiting for the trigger.  You trigger attempt.jpg, what will happen is that the task is configured and started.  When starting, running VI will proceed to the loop where you call the read I.  The map will wait for relaxation, with no sample being acquired until the material sees the trigger.  If the trigger is never sent, the loop will iterate that you have not the VI wait indefinitely, but only for 10 seconds.  Thus, if no data is received, the loop will iterate every 10 seconds. If you want to read to wait indefinitely, the value of the timeout on DAQmx Read.vi-1.

    All that being said, it is not quite clear what is the problem with your attempt to trigger - everything looks good to me; are you an error?  Or the just VI hang up (which could be due to the fact that the relaxation is never received)?

    Let me know if it helps.

    Cheers, Matt

Maybe you are looking for