Want to get the records of only numeric values

I have tables sales_order, with column ATTRIBUTE_8 VARCHAR2 (50) and job_order with column NUMBER HIGH_AMOUNT.

attribute_8 column of the sales_order table has both numerical values & character values.  For example:-32232.3764, 234283.878, YES, NOT... etc.

I intend to load data of tabe sales_order to job_order. For all non-numeric values of ATTRIBUTE_8, I want to do as a 0.

Please indicate an INSERT statement to achieve this.

create or replace function clean_number(p_string in varchar2) return number is
begin
  return to_number(p_string);
exception when value_error then
  return 0;
end clean_number;
/
with input(ATTRIBUTE_8) as (
  select '-32232.3764' from dual union all
  select '234283.878' from dual union all
  select 'YES' from dual union all
  select 'NO' from dual union all
  select '1e4' from dual
)
select attribute_8, clean_number(attribute_8) high_amount from input;
ATTRIBUTE_8 HIGH_AMOUNT
-32232.3764 -32232.3764
234283.878 234283.878
YES 0
NO. 0
1E4 10000

Tags: Database

Similar Questions

  • How to get the day as a numeric value without the date in shape?

    Hello
    to reduce the costs of a sql statement, I need to get the day of a date under the number (to compare to a numerical value) value without formatting. Each formatting causes a complete table of the table scan and the date field. Is there a function for this problem?

    Version of Oracle's 11g.

    Thank you Carsten

    You can use EXTRACT...

    SQL> select extract(day from sysdate) from dual;
    
    EXTRACT(DAYFROMSYSDATE)
    -----------------------
                          7
    
    SQL>
    
  • Get the lines containing only numbers and English characters

    ΗΙ,

    Assume that there are the following lines:

    Select 'RE89203' Union double all the

    Select 'cd89203' Union double all the

    Select 'cD89203' Union double all the

    Select 'CZC4255463' Union double all the

    Select '597CD83843KL' Union double all the

    Select CD 90832 83843FE 597' a Union double all the

    Select 597 CD 90832 ~ 83843FE' a Union double all the

    Select 'CD9083283843FΔ' Union double all the

    Select 'CD9083283843FΑ' of the double

    In the list above, I want to get the lines containing at least a figure and English at least one character (in capital), but with the exception of these, any other character is not acceptable (and the line as well).

    I tried the following, but the result set is not the direction you want:

    with sample_data as

    (

    Select 'RE89203' Union double all the

    Select 'cd89203' Union double all the

    Select 'cD89203' Union double all the

    Select 'CZC4255463' Union double all the

    Select '597CD83843KL' Union double all the

    Select CD 90832 83843FE 597' a Union double all the

    Select 597 CD 90832 ~ 83843FE' a Union double all the

    Select 'CD9083283843FΔ' Union double all the

    Select 'CD9083283843FΑ' of the double

    )

    Select one

    of sample_data

    where regexp_like (, ' [A - Z] [[: digit:]] ',' it)

    Explanations:

    The value "cD89203" is not acceptable because it contains the character 'c' (in lowercase).

    597 90832 83843FE record value CD' is not acceptable because there is a space.

    597 90832 record value CD ~ 83843FE' is not acceptable because there is a character "~".

    The value "CD9083283843FΔ" is not acceptable because there is a non-English (character 'Δ') character.

    The value of the last record "CD9083283843FΑ" is not acceptable because there is a non-English (character 'Α') character.

    Note:

    I'm using OraDB 11 g v2

    with sample_data as
    (
    select 'RE89203' a from dual union all
    select 'cd89203' a from dual union all
    select 'cD89203' a from dual union all
    select 'CZC4255463' a from dual union all
    select '597CD83843KL' a from dual union all
    select '597CD90832 83843FE' a from dual union all
    select '597CD90832~83843FE' a from dual union all
    select 'CD9083283843F?' a from dual union all
    select 'CD9083283843F?' a from dual union all
    select 'ABCDEF' a from dual union all
    select '1234' a from dual
    )
    select a
    from sample_data
    where replace(translate(translate(a, '~', '#'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'), '~', null) is null
    and regexp_like(a, '[A-Z]')
    and regexp_like(a, '[0-9]')
    /
    

    Edit: See post of Chris Hunt for a more efficient version of the line 17.

  • Hi, well, I want to get the creative cloud cuz I need for my career as urgent, but I will change my phone soon, so my question is... can I install in my pc, and then move them to another without paying again or something?

    Hi, well, I want to get the creative cloud cuz I need for my career as urgent, but I will change my phone soon, so my question is... can I install in my pc, and then move them to another without paying again or something?

    Yes.

    You can install an unlimited number of computers.  You can connect to up to two computers at any time (and you must be connected to use your cc programs).

    It's quick and easy to sign in and out, so there is no downside on the use of the cc on different computers.  legally, only the licensee is authorized to use the subscription of the cc if you can't share your programs with another person, but this is the only restriction.

    you have just installed you are the application of cc desktop on any computer you use, Download Adobe Creative Cloud apps | CC free trial Adobe

    Connect, connect and disconnect activate Cloud Creative applications

    Use the desktop application to install your programs of cc.

  • I want to get the multiple tilesetters name.

    I want to get the multiple tilesetters name.

    The command "activeDocument.activeLayer" returns only a layer name. Even if several layers have been selected.

    I can solve the problem?

    Please try this example...

    #target Photoshop
    app.bringToFront();
    main();
    function main(){
    if(!documents.length) return;
    var selectedLayers = getSelectedLayersIdx();
    var selectedLayersNames =[];
    for(var a in selectedLayers){
        selectedLayersNames.push(getLayerNameByIndex( Number(selectedLayers[a]) ));
        }
    alert("Number of Layers selected = " + selectedLayers.length + "\rLayer Names = " + selectedLayersNames.toString());
    }
    
    function getLayerNameByIndex( idx ) {
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Nm  " ));
        ref.putIndex( charIDToTypeID( "Lyr " ), idx );
        return executeActionGet(ref).getString(charIDToTypeID( "Nm  " ));;
    };
    function getSelectedLayersIdx(){
          var selectedLayers = new Array;
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
             desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count
              var selectedLayers = new Array();
              for(var i=0;i		   
  • How do I get the width of a numeric field when running

    Hi, everyone :D
    There is a built-in function that allow me to get the width of a numeric field when running? The SRW bulit in only has the SWR. Built-in GET_PAGE_NUM. is there something like the Get_item_property of report forms?

    Thank you

    Published by: user12422762 on 07/ene/2010 14:16

    Published by: user12422762 on 07/ene/2010 14:30

    Published by: user12422762 on ene / 08/2010 04:40

    Published by: user12422762 on ene / 08/2010 04:50

    Why did you adjust the mask format?, just use one that is long enough to fit the longest value. use something like "FM999G999G999G999", the FM will remove the leading spaces.

  • I want to get the current music, I have on my iPod out of it and start again. How can I do this?

    I want to get the current music, I have on my iPod out of it and start again. How can I do this?

    Open iTunes, plug in the iPod, select what you want to be on your iPod, sync.

  • [Labview] I want to get the average value in each new 100 samples.

    Hello. I'm Sophie.

    I'm studying Labview for my research.

    For me, the sampling frequency is 125KHz.

    I want to get the average value in each new 100 samples.

    Therefore, I want to get an average value of 1 ~ 100th samples and store this average value. Call assets(1).

    Then, I want to get an average of 101 ~ 200th samples and store this means value, call moyen2.

    .

    .

    .

    .

    I don't know how me I want.

    Thank you

    Sophie.

  • When you watch the steaming video, I get the sound but only a green screen Uni.

    * Original title: video

    When you watch the steaming video, I get the sound but only a green screen Uni.

    Moved from the center of Community Participation.

    Hello

    As you don't give any information about your computer operating system or software, all I could suggest is to install a codec Pack.

    http://www.SnapFiles.com/get/k-Lite-full.html

    Follow this information here too:

    "FYI: . During our review, we found that this program offers to install promotional, third party components. Installation of these components is optional, but you should pay attention when installing'

    See you soon.

  • I really want to get the IMAQ Image IMAQ Arry case to Image.vi files

    Hello!

    Although already, I installed LabVIEW8.2 and NOR-IMAQ, I don't have IMAQ Image cases and IMAQ Arry Image.vi files.

    To use the infrared camera, I need them.

    I really want to get the case Image IMAQ Arry Image.vi files IMAQ.

    How can I get these files?

    Please, let me know the methods.

    Sincerely!

    Thank you very much for your explanation.

    Solve the problem.

    Have a nice day ^ ^

  • I want to get the update on cd

    I want to get the update on cd

    You may be able to order service packs on CD, but nothing else.

    Service Packs Office-
    http://Office.Microsoft.com/en-us/downloads/FX010383631033.aspx

    Vista: http://www.microsoft.com/windows/windows-vista/quick-start/service-packs.aspx
    See: https://om.one.microsoft.com/opa/Validation.aspx?StoreID=57d2f336-6a91-4936-a0ac-bf64ae6547c9&LocaleCode=en-us&JavaScriptOn=yes

    Order Windows XP Service Pack 3 on a command of CD for Windows XP SP3 on a CD, visit one of the following Microsoft Web sites, depending on your region:

    Asia

    https://OM2.one.Microsoft.com/OPA/start.OM?StoreID=D7A098F4-4034-4CCB-A785-9E890E6B4F5B&LocaleCode=en-us&NewTrans=1 (https://om2.one.microsoft.com/opa/start.om?StoreID=D7A098F4-4034-4CCB-A785-9E890E6B4F5B&LocaleCode=en-us&NewTrans=1)

    Europe and Africa

    https://OM2.one.Microsoft.com/OPA/start.OM?StoreID=7B7AA929-BD0A-487A-BC7E-DF7631FEE660&LocaleCode=en-us&NewTrans=1 (https://om2.one.microsoft.com/opa/start.om?StoreID=7B7AA929-BD0A-487A-BC7E-DF7631FEE660&LocaleCode=en-us&NewTrans=1)

    North America

    https://OM2.one.Microsoft.com/OPA/start.OM?StoreID=CE6E3AFC-6B25-4F99-8913-3E3453AD966D&LocaleCode=en-us&NewTrans=1 (https://om2.one.microsoft.com/opa/start.om?StoreID=CE6E3AFC-6B25-4F99-8913-3E3453AD966D&LocaleCode=en-us&NewTrans=1)

    South America

    https://OM2.one.Microsoft.com/OPA/start.OM?StoreID=2CE39C54-6B20-417F-B9C0-9F513FA18153&LocaleCode=en-us&NewTrans=1 (https://om2.one.microsoft.com/opa/start.om?StoreID=2CE39C54-6B20-417F-B9C0-9F513FA18153&LocaleCode=en-us&NewTrans=1)

    You can search the rest as you have not yet advised what operating system you have etc.

    TaurArian [MVP] 2005-2010 - Update Services

  • I just want to get the load down, so I can move to windows 7 Pro that I just paid for. I can't believe that it should be this difficult.

    I have a key for download. I just want to get the load down, so I can move to windows 7 Basic windows Pro 7 I just paid for. I can't believe that it should be this difficult.

    Why couldn't there was a link on the confirmation e-mail to download the program.

    You can use the product key and the Basic Express in Windows 7 Home Edition upgrade upgrade to Windows 7 Professional.

    If the license for Windows 7 Professional, you have access to is a retail version update or complete, you can use the product key and the Express upgrade from Windows 7 Home Basic to Windows 7 Professional. First of all, check that the edition of Windows 7, you are upgrading is already enabled (if it isn't, you will encounter complications and that you might start all by performing a clean installation). Click Start, type Anytime Upgrade, click on the option enter a key, enter the key of Windows 7 Professional on demand, click Next, wait while checking the key, accept the license agreement, click on upgrade, wait while the software upgrades, (it may take 10 minutes or more depending on the if updates are required) your computer restarts automatically, after the reboot, Windows 7 will notify you updating the computer, the computer will restart once more automatically and will be completed the upgrade, a window will appear notifying the upgrade was successful and your computer is ready to use, click Close, you should be upgraded to Windows 7 Professional your files, programs and settings retained.

  • I want to get the icon facebook for magical canvas of Hp?

    I want to get the icon facebook for magical canvas of Hp?

    Please contact the Facebook Support for help with this issue:

    http://www.Facebook.com/help/?page=220217228006012

    http://www.Facebook.com/help/

    http://www.thefacebookforum.com/

  • Copy of the device. I want to get the pistures of him out of it to share with friends... and fam is there a way I can do this?

    I got a slideshow of my preschool son and I want to get the pistures of him out of it to share with friends... and fam is there a way I can do this?

    You can use copy and paste.  Help Windows 7 & support:

    Copy and paste a file

    When you copy and paste a file, you make a copy of the original file that you can then modify independently of the original file. If you copy and paste a file to a different location on your computer, it's a good idea to give it a different name, so that you'll remember which file is new and which file is the original.

    To copy and paste a file:

    1. Open the location that contains the file you want to copy.

    2. Right click on the file and then click on copy.

    3. Open the location where you want to store the copy.

    4. Right-click on an empty space within the location and then click on paste. The copy of the original file is now stored in the new location.

    For more information about copying multiple files, see select multiple files or folders.

    Tips

    • Another way to copy and paste files is to use the keyboard shortcuts Ctrl + C (copy) and Ctrl + V (paste).

    • You can also press on and hold the right mouse button and drag the file to the new location. When you release the mouse button, click on copy here.

    • You can copy and paste a folder in the same way as you would a file. When you do this, all the files in the folder are also copied.

    -

    Good luck.

  • How can I update my version of Adobe Captivate, I have version 8 and I want to get the version 9

    How can I update my version of Adobe Captivate, I have version 8 and I want to get the version 9

    Go to the sales and purchase the new version

Maybe you are looking for

  • Lenovo Thinkpad Yoga X 1 touch screen does not work

    Hi all I just bought a brand new Thinkpad Yoga X 1 and out of the box, the touch screen is not recognized by windows and no entry through fingers or via pen works. I would be very happy if someone could tell me if it's just a wrong settings or if the

  • Zbook g2 17: external monitor for Zbook 17 "G2

    I want to connect my Zbook 17 "G2 to an external monitor with a DVI - D input (Eizo 19 - resolution max 1280 * 1024).Big doubt: the Displayport output left in the laptop is suitable to do?I thought to buy an adapter Displayport to DVI - D and connect

  • Display the characters on the wireless network passwords

    I need to see my password for my wireless network connection, but when I go to manage wireless networks and then click on the network, and click on the Security tab of the password is in the show characters check box and points black is grey-ed out s

  • Questions from the Media Suite

    Hello.  I have a new computer to window 8 HP.  Media Suite is on the computer.  Y at - it a book or a tutorial to help me use this feature? I want to use pictures of my library of images and photos from my photo gallery for doing this, and I thought

  • BlackBerry Q5 cannot take photos but the video works fine

    Hello world I've recently updated the operating system. I just tried to take a picture, and although he focuses although I can't actually take a shot. Singularly I record movies without problems, however. A few days ago I could do both, and the only