Can I find strings which contain non-numeric characters?

I would like to be able to report a column where the value contains any character which is not 0-9 though spaces are valid and exceptions are - and .
Is this possible in a single SQL statement?
thanks

Is it what you need ?
SQL> select col from (
  2  select 'abcdef-98718' col from dual
  3  union all
  4  select '123 - u9191 - 9919' col from dual
  5  union all
  6  select '0091 - 221919-8818' from dual
  7  union all
  8  select '0091 - 221919 + 8818' from dual
  9  union all
10  select '0091 - 777 - 11' from dual
11  )
12  where trim(translate(col,'0123456789-',' ')) is not null
13  /
COL
abcdef-98718
123 - u9191 - 9919
0091 - 221919 + 8818In 10G:
SQL> select col from (
  2  select 'abcdef-98718' col from dual
  3  union all
  4  select '123 - u9191 - 9919' col from dual
  5  union all
  6  select '0091 - 221919-8818' from dual
  7  union all
  8  select '0091 - 221919 + 8818' from dual
  9  union all
10  select '0091 - 777 - 11' from dual
11  )
12  where trim(regexp_replace(col,'[[:digit:],-]',' ')) is not null
13  /
COL
abcdef-98718
123 - u9191 - 9919
0091 - 221919 + 8818Rgds.

Similar Messages

  • Regex with strings that contain non-latin chars

    I am having difficulty with a regex when testing for words that contain non-latin characters (specifcally Japanese, I haven't tested other scripts).
    My code:
    keyword = StringUtil.trim(keyword);
    //if(keywords.indexOf(keyword) == -1)
    regex = new RegExp("\\b"+keyword+"\\s*;","i");
    if(!regex.test(keywords))
    {Alert.show('"'+keywords+'" does not contain "'+keyword+'"'); keywords += keyword + "; ";}
    Where keyword is
    日本国
    and keywords is
    Chion-in; 知恩院; Lily Pond; Bridge; 納骨堂; Nōkotsu-dō; Asia; Japan; 日本国; Nihon-koku; Kansai region; 関西地方; Kansai-chihō; Kyoto Prefecture; 京都府; Kyōto-fu; Kyoto; Higashiyama-ku; 東山区; Places;
    When the function is run, it will alert that keywords does not contain keyword, even though it does:
    "Chion-in; 知恩院; Lily Pond; Bridge; 納骨堂; Nōkotsu-dō; Asia; Japan; 日本国; Nihon-koku; Kansai region; 関西地方; Kansai-chihō; Kyoto Prefecture; 京都府; Kyōto-fu; Kyoto; Higashiyama-ku; 東山区; Places; " does not contain "日本国"
    Previously I was using indexOf, which doesn't have this problem, but I can't use that since it doesn't match the whole word.
    Is this a problem with my regex, is there a modifier I need to add to enable unicode support or something?
    Thanks
    Dave

    ogre11 wrote:
    > I need to use refind to deal with strings containing
    accented characters like
    > ?itt? l?su, but it doesn't seem to find them. Also when
    using it with cyrillic
    > characters , it won't find individual characters, but if
    I test for [\w] it'll
    > work.
    works fine for me using unicode data:
    <cfprocessingdirective pageencoding="utf-8">
    <cfscript>
    t="Tá mé in ann gloine a ithe;
    Nà chuireann sé isteach nó amach
    orm";
    s="á";
    writeoutput("search:=#t#<br>for:=#s#<br>found
    at:=#reFind(s,t,1,false)#");
    </cfscript>
    what's the encoding for your data?

  • How can I remove non-numeric characters from a cell?

    I have a file an rtf file that I can open in Numbers. It puts each line in a separate cell. Each cell contains non-numeric and numeric characters. I'd like to delete the non-numeric characters so that I can add the numbers together. Is there a way to do this easily in Numbers that doesn't require doing it manually?
    Thanks,
    David

    Ok, David,
    This solution will work for vlaues up to 99,000 and if there is a space in front of your amount. There are two parts for clarity but you could wrap them up into one formula if you wanted to.
    B2 =FIND(" ",A2,LEN(A2)−9)
    C2 =MID(A2,B2,10)
    If there is a return before your amount (certain cells in your screenshot got me wondering) then the formula in column B
    =FIND("
    ",A2,1)
    It looks funny because it is finding the return.
    Let me know if this works for you.
    quinn

  • Does Oracle User Password can contain non-ASCII characters?

    Hi Experts,
    Can we create a user with password containing non-ASCII characters like "Ro'çá".
    I was able to create a database instance by providing the password for sys as "Ro'çá". But now i am not able to login from command prompt using sqlplus or SQLPLUS Application. I am getting below error:
    C:\Documents and Settings\xyz>sqlplus system/Ro'çá@test
    SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jul 4 12:17:33 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    Enter user-name:
    same in case i enclose the password in ""
    C:\Documents and Settings\xyz>sqlplus system/"Ro'çá"@test
    SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jul 4 12:17:33 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    Enter user-name:
    same in case i enclose the password in ""
    Also using create user i am not able to create user with password in non-ASCII characters but alter user works and changes the password to non-ASCII characters when enclosed in quotes.
    I wanted to know whether the password can contain non-ASCII characters or not?
    Thanks in advance for your help.

    I don't think that the characters used are allowed. See this doc which only mentions three characters to be used .
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10575/tdpsg_user_accounts.htm#BEICECGF
    I did try the same but it didn't work for me either.
    SQL> select * from V$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> grant connect to user1 identified by Ro'çá;
    ERROR:
    ORA-01756: quoted string not properly terminated
    SQL> grant connect to user1 identified by "Ro'çá";
    Grant succeeded.
    SQL> connect uesr1/"Ro'çá";
    ERROR:
    ORA-01017: invalid username/password; logon denied
    Warning: You are no longer connected to ORACLE.
    SQL> connect uesr1/"Ro'çá"
    ERROR:
    ORA-01017: invalid username/password; logon denied
    SQL> connect uesr1/"Ro'çá"
    ERROR:
    ORA-01017: invalid username/password; logon denied
    SQL>HTH
    Aman....

  • I want to update my phone, but i purchased many apps and music on the phone. it won't let me authorize my computer so i cannot update. i don't want to deauthorize all my computers. how can i find out which 5 computers i have authorized?

    i want to update my phone, but i purchased many apps and music on the phone. it won't let me authorize my computer so i cannot update. i don't want to deauthorize all my computers. how can i find out which 5 computers i have authorized? also how can i update the software?

    This is a tedious solution, which is stupid!  And some users report an inability to reauthorize a computer after an "en masse” deauthorization.  I can’t believe Apple doesn’t provide a list or menu to find out which computers you’ve authorized! Obviously, APPLE knows (or else they couldn’t tell us how many computers we have authorized)--so why can’t they give us access to that information about our own computers??!!!
    And for an already-authorized computer with a hard drive that’s since been replaced and upgraded from Mavericks to Yosemite, would it be recognized as a “new computer” and require authorization? Would its previous incarnation (i.e., with the old hard drive and OS) be considered a separate computer? Some users report they can’t authorize a computer after an OS upgrade because of that. Can’t believe we have to do such a bass-ackwards kludge!

  • I share an itunes account with 3 users. How can I find out which person downloaded a certain app?

    I share an itunes account with 3 users. How can I find out which person downloaded a certain app?

    Agile,
    Any of the above will work, depending how you would like to set it up.
    Given that kids tend to eventually grow up and be independent, the best long term answer for most people is to let her have her own account and her own library as soon as she can handle it.  Keep in mind that content purchased from the iTunes Store is permanently tied to the account from which it was originally purchased, so separating later is a challenge.
    If you want to sync multiple devices to the same library, that will work.  Or if you want separate libraries (as I would recommend), they can be either on separate computers or on separate Windows user accounts on the same PC.
    For the name change:  Connect the device.  When the name appears in the left sidebar of iTunes, highlight it and change it.

  • How can I find out which .pst or .ost file itunes referres to when synchronising with outlook

    I´ve switched to iphone 4S from my 3Gs and would like to "clean" my itunes Sync before I use the new phone. Problem is, that the synchronisation with Outlook 2003 doesn´t work anymore. I guess the reason is that itunes refers to an old .ost or .pst file on my computer. I ve got several outlook profiles and changed from exchange to pop3. My question: How can I find out which .pst or .ost file itunes referres to?
    Thanks a lot in advance :-)

    Select the tune and then - Get Info - in the dialog box is a note of the Apple ID used to purchase.
    MJ

  • I have my personal music (not purchased from Itunes) stored in two locations, on my PC and on an external HD. How can I find out which directory itunes uses to access this music? I am using Itunes version 11.4.0.18. Thanks

    I have my personal music (not purchased from Itunes) stored in two locations, on my PC and on an external HD. How can I find out which directory itunes uses to access this music? I am using Itunes version 11.4.0.18. Thanks

    Many thanks JEM24 for your help.  Ive just spent the best part of six hundred pounds on a new Sony Rx100m2 compact camera, so I have no interest in the Ipods camera at all really. I doubt Ill be watching many videos on it as Im very lucky in that I have a good Android tablet. Its more as a stock music player that Ill be buying the Ipod for, if indeed I do end up buying one. I dont like the idea of paying the exorbitant amount added for more memory space that Apple along with most other companies charge. In fact I read an article on this very subject just yesterday in the tech section of Flipboard. It stated in the article that in the case of the Iphone  the actual cost of each additional  gigabyte of storage  to Apple et al is something in the order of 60p.. This is certainly not reflected in the price us the customer has to pay at the till.. Its for this reason primarily that Apple in particular, because their products do not allow adding expandable memory of your own in the form of cheap to buy cards, that nobody in their right mind buys the 64gig etc Iphones..I am aware that we are discussing my potential purchase of an Ipod Touch here but you see my point. Many thanks again though for helping me.

  • How to load file thru reader which contains non-english char in file name

    Hi ,
    I want to know how to load file in english machine thru reader which contains non-english chars in file names (eg. 置顶.pdf)
    as LoadFile gives error while passing unicode converted file name.
    Regards,
    Arvind

    You don't mention what version of Reader?  And you are using the AcroPDF.dll, yes?
    Sent from my iPad

  • How can i find out which network my iphone is locked to

    Sorry if iv posted this in the wrong section.well the question is quite simple. how can i find out which network my iphone 4s is locked to, without purchasing sim cards from every network.
    I just bought the phone second hand with no sim as a birthday present for my wife with the intention of getting it unlocked (not jailbroken)
    If any body can give me any advice it would be greatly appreciated.

    call Apple

  • Replace Non-Numeric Characters with a Numeric Character in a String

    Hi Guys,
    I need to replace all the non-numeric characters (including embedded blanks & hyphen) in a string to a numeric character '1'.
    The trailing blanks should not be replaced.
    e.g. "P22233344455566" should be changed to "122233344455566"
    &    "49-1234567           " should be changed to "4911234567          "
    Please help.

    Use [replace|http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm] with a regular expression to translate any non-numeric character (i.e. any character not between 0 and 9) to 1:
      REPLACE ALL OCCURENCES OF REGEX '[^0-9]' IN value WITH '1'.
    Cheers, harald
    p.s.: In older releases [translate|http://help.sap.com/abapdocu_70/en/ABAPTRANSLATE.htm] would also do the trick, but is more lengthy, because one would need to specify each individual character that should be replaced, e.g.:
      TRANSLATE value TO UPPER CASE.
      TRANSLATE value USING
          ' 1_1-1a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1'.

  • Removing Non-numeric characters from Alpha-numeric string

    Hi,
    I have one column in which i have Alpha-numeric data like
    COLUMN X
    +91 (876) 098 6789
    1-567-987-7655
    so on.
    I want to remove Non-numeric characters from above (space,'(',')',+,........)
    i want to write something generic (suppose some function to which i pass the column)
    thanks in advance,
    Mandip

    This variation uses the like operators pattern recognition to remove non alphanumeric characters. It also
    keeps decimals.
    Code Snippet
    CREATE FUNCTION dbo.RemoveChars(@Str varchar(1000))
    RETURNS VARCHAR(1000)
    BEGIN
    declare @NewStr varchar(1000),
    @i int
    set @i = 1
    set @NewStr = ''
    while @i <= len(@str)
    begin
    --grab digits or (| in regex) decimal
    if substring(@str,@i,1) like '%[0-9|.]%'
    begin
    set @NewStr = @NewStr + substring(@str,@i,1)
    end
    else
    begin
    set @NewStr = @NewStr
    end
    set @i = @i + 1
    end
    RETURN Rtrim(Ltrim(@NewStr))
    END
    GO
    Code to validate:
    Code Snippet
    declare @t table(
    TestStr varchar(100)
    insert into @t values ('+91 (8.76) \098 6789');
    insert into @t values ('1-567-987-7655');
    select dbo.RemoveChars(TestStr)
    from @t

  • Removing non-numeric characters from string

    Hi there,
    I need to have the ability to remove non-numeric characters from a string and I do not know how to do this.
    Does any one know a way?
    Example:
    Present String: (02)-2345-4607
    Required String: 0223454607
    Thanks in advance

    Dear NickM
    Try this this will work...........
    create or replace function char2num(mstring in varchar2) return integer
    is
    -- Function to remove Special characters and alphebets from phone no. string field
    -- Author - Valid Bharde.(India-Mumbai)
    -- Date :- 20 Sept 2006.
    -- This Function will return numeric representation.
    -- The Folowing program is gifted to NickM with respect to his post on oracle site regarding Removing non-numeric characters from string on the said date
    mstatus number :=0;
    mnum number:=0;
    mrefstring varchar2(50);
    begin
    mnum := length(mstring);
    for x in 1..mnum loop
    if (ASCII(substr(upper(mstring),x,1)) >= 48 and ASCII(substr(upper(mstring),x,1)) <= 57) then
    mrefstring := mrefstring || substr(mstring,x,1);
    end if;
    end loop;
    return mrefstring;
    end;
    copy the above program and use it at function for example
    SQL> select char2num('(022)-453452781') from dual;
    CHAR2NUM('(022)-453452781')
    22453452781
    Chao!!!

  • HT1338 HOW CAN I FIND OUT WHICH SERVER MY MAC IS USING?

    HOW CAN I FIND OUT WHICH SERVER MY MAC IS USING, KEEP GETTING MICROSOFT SQL SERVER ERRORS
    WHEN TYPING IN ADDRESS'S?

    If your computer is tied to a network, then there is a way to check. Go to System Preferences, and click Accounts. unlock Admin
    then you can click Login Options.
    under that, Network Account Server. This should show you what server your computer is tied to. If you aren't in the tech department, you could try asking them.

  • My Library has ten more songs than my iPod. How can I find out which songs are not syncing?

    My Library has ten more songs than my iPod. How can I find out which songs are not syncing?
    I recently had to purchase a new hard drive. Because the size of my music collection exceeds 140 GB, I stored all of my music on a separate external hard drive. When I exported everything back into my new iTunes library, I found that I had about 200 more songs than I had in the previous library. After deleting most of those extraneous songs, I was able to get my library close to where it was before. However, after syncing to my iPod Classic, I noticed that only 34,853 of the 34,863 loaded. How can I figure out which of those ten songs in my library did not sync to my iPod?
    Yellow12

    It may be that the 10 songs are unchecked. To find them select songs view.
    If there is a column Heading marked with a tick then click on it to sort by this column.
    If the Column is not there then View > View Options and select the Checked column which will then display
    Check the songs by putting ticks in the empty boxes and resynch. Now those tracks should go over as well

Maybe you are looking for

  • How can I use this RFC function

    I just wanna create a monitor as same as TCODE ST06 so I Added a TextBox, a Button and a DataGrid. and then everything has finished.as same as following step for "RFC_CUSTOMER_GET" from SAP connector 2.0 help but how can I use the function? (VB.net 2

  • Replaced Ipod issues

    I recently had my Ipod replaced because it broke and was corrupted. When I connect my new Ipod to ITunes it keeps telling me I need to restore it when it works perfectly and I don't want to restore because I'll lose all the songs I just put on it....

  • Apple TV brought by Santa

    I just hooked up the Apple TV and after a bit have it working with everything except sound through my Bose sound system. It plays audio through the TV speakers but I cannot get audio out of the Bose. I can play movies, music, podcasts, etc but no aud

  • Misalignment between FEBA and GL account of the corresponding bankaccount

    Hi, For CCXXXX the balance in FEBA for the USD bank account does not agree to the balance in the GL account. The difference is too big to originate in the revaluation. According to the GL account, the balance is AUD 203.400, according to FEBA, the ba

  • Need Help! Satellite Laptop freezes

    Need Help.  My Satellite laptop keeps freezing when you try to play music or a video.  It also freezes on certain websites.