Select only non-numeric characters

A
$
^
(78^*)5$#7
)!@#$0-99
_454*(&--0
+@#$%564
=123
How select only non-numeric characters from above table?

Nilesh Hole,Pune, India wrote:
but i want a uniqe query.
suppose table have n number of rows then how i will wirte a query.Not sure what you mean? Do you want to select a list of distinct non-numeric characters used in your table? Then:
column "Distinct non-numeric chars" format a30
with t as (
           select '!' a from dual union all
           select '@' from dual union all
           select '#' from dual union all
           select '$' from dual union all
           select '%' from dual union all
           select '^' from dual union all
           select '&' from dual union all
           select '*' from dual union all
           select '(78^*)5$#7' from dual union all
           select ')!@#$0-99' from dual union all
           select '_454*(&--0' from dual union all
           select '+@#$%564' from dual union all
           select '=123' from dual union all
           select '135790' from dual
select  distinct substr(a,column_value,1) "Distinct non-numeric chars"
  from  (
         select  regexp_replace(a,'[[:digit:]]') a
           from  t
           where not regexp_like(a, '^[[:digit:]]+$')
        table(
              cast(
                   multiset(
                            select  level
                              from  dual
                              connect by level <= length(a)
                   as sys.odcinumberlist
Distinct non-numeric chars
+
=
$
Distinct non-numeric chars
^
14 rows selected.
SQL> SY.

Similar Messages

  • Safari "tel:" phone number links stripping non-numeric characters

    After a week of owning my iPhone (two weeks after it launched) I made myself a little web interface that contain various iPhone-helpful links. Four of these were AT&T specific telephone links:
    *646# - check how many minutes remaining
    *729 - pay your bill
    etc etc..
    (e.g. <a href="tel:*729">click here to pay your bill</a>)
    Well, needless to say this was a very convenient feature, however these links no longer function properly. It seems that the iPhone is now stripping any/all non-numeric characters from the link (although I haven't done extensive testing to see exactly which characters .. only with * and $ in particular).
    I've even tried HTML entities but they were stripped too.
    Now I know apple had a security fix a few patches back, one that fixed a vulnerability involving "tel:" links (CVE-2007-3755), but I haven't found any documentation regarding special characters now being ignored/stripped.
    So, my question is does anyone know if there is a workaround for this, or did the patch inadvertently and permanently destroy the ability to send these very helpful text messages via a web interface?
    Thanks,
    Marc

    I'm having a similarly annoying behavior with "tel:" links. I'm doing the same thing -- writing a web page to store some convenient numbers, but for me, it's for teleconference numbers. You dial into a toll-free number, then after a pause, dial in a passcode.
    On the iPhone's contact list, you can program in the pauses as the letter "p."
    However, in a tel: link, the p's change to 7's. Interesting!
    What I've discovered is that, for me (FW 1.1.2), alphabetical characters are translated into their numerical equivalents. So 1-800-COMCAST (a number I've had to dial all too much recently) gets rendered to 18002662278.
    This is a difference between Safari 3 and the iPhone version. On Safari 3 on the Mac, both the HTML and a mouseover shows that the tel link contains the letters. On the iPhone, though, clicking the link brings up a dialog box with the letters "translated."
    So, interesting -- but now I have a problem. How do I enter a pause into a tel link?

  • 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!!!

  • Query only non numeric values in a column

    How to query only non numeric values in a cloumn.
    For example:
    Table1 has a column1(col1)
    Values:
    Row Value
    1 27376
    2 47D99
    3 83039
    4 DKFI*
    5 3J6
    Query should retrieve only rows(2,4,5).
    Thanks! for help
    Murali

    Version 2(PL/SQL) above is not clear enough, It can be tuned to the following:
    -- Create a function
    Create or replace function IsVARCHAR(pCol VARCHAR2) return VARCHAR2
    AS
    vNumber NUMBER := 0;
    begin
      vNumber := to_number(pCol);
      RETURN NULL;
    Exception
      When Others Then
        RETURN pCol;
    End;
    -- To See VARCHAR values (alpha-numeric) only!
    SELECT col1 FROM tab1
    WHERE IsVARCHAR(col1) IS NOT NULL;
    -- To See NUMBER values only!
    SELECT col1 FROM tab1
    WHERE IsVARCHAR(col1) IS NULL;Versatility here with PL/SQL, but I personally like SQL versions.
    Thx,
    SriDHAR

  • 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

  • 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'.

  • Catching errors such as divide by zero and typing non-numeric characters

    Fellows: How do I extend following script to catch errors such as divide by zero and typing non-numeric characters.      Thanks
    This program takes two integers (whole numbers), then displays the sum, average, division,
    Modula of those numbers and finally the first number raised to the power of the second number.
    import java.io.*;
    public class HWOne
         public static void main(String[] args) throws IOException  // error handling
              // variable declaration
              String firstdigit, seconddigit;
              int first, second, sum, total, modus, power;
              float division;
              double average;
              BufferedReader myIn = new BufferedReader(new InputStreamReader(System.in));
              //Invoke user response
              System.out.print("Please enter first digit ");
                   firstdigit = myIn.readLine();
                   first = Integer.parseInt(firstdigit);
              System.out.print("Please enter second digit ");
                   seconddigit = myIn.readLine();
                   second = Integer.parseInt(seconddigit);
              //computations
              sum = first + second;
              average = (double)sum / (double)2;
              division = (float)first / (float)second;
              modus = first % second;
              power = (int)Math.pow(first, second);
              //Screen message
              System.out.println("Sum: " + sum);
              System.out.println("Average: " + average);
              System.out.println("Division: " + division);
              System.out.println("Modula: " + modus);
              System.out.println("Power: " + power);

    Have you learnt about try/catch statements yet?
    The parseInt method throws a NumberFormatException. So you place the call to that method inside a try statement and catch the exception.
    For divide by zero, you can use an if statement. If the divisor != 0 perform division.

  • How to select only last 4 characters in a column of type varchar2

    The data in column P_JACKS.LABEL is in the form of:
    294-001,
    B01-099,
    194A-098,....
    I'd like to select only the 3 characters following the '-' dash, and find the maximum of that set.
    This must be simple, I know, but so am I. Can someone please help me with this?
    Thanks!!

    I'm sure there is some slick regexp way to do it but this should work
    WITH t AS
      (SELECT '294-001' value FROM dual
      UNION ALL
      SELECT 'B01-099' FROM dual
      UNION ALL
      SELECT '194A-098' FROM dual
    SELECT greatest( (SUBSTR( value,LENGTH(value)-2,1)), (SUBSTR( value,LENGTH(value)-1,1)), (SUBSTR( value,LENGTH(value))) )
    FROM tmaybe I misunderstood do want to the max for the whole group as in 99
    or did you mean 3 rows with values
    1
    9
    9
    which is what I did
    Edited by: pollywog on Sep 9, 2010 6:45 PM
    Edited by: pollywog on Sep 9, 2010 6:47 PM

  • Check for non-numeric characters in textbox input

    I have a form with several textboxes, each of which can accept numeric input. I want to write a validation/ plsql block that checks for a non-numeric character in the input, so that my user sees a customized error message rather than a database error. Any tips on how I can achieve that? Is there any function like "isalpha" in C, which can directly do the job?
    Also, some of these numeric fields should allow commas, since people put commas in larger numbers.
    Any help is greatly appreciated.

    Arie,
    i figured it out. turns out, i had some confusion in my mind. i modified Taneal's solution to use it in my already existing validations of type 'function returning error text' and it works fine.
    the problem before was that i was running 2 separate validations on the same field, and probably due to the sequence numbers, i was getting a numeric or value error. now, i've combined all validations into a single validation and it works fine.
    and honestly, i'm pretty bad with reg. ex. :D

  • Disable typing of non-numeric characters for numeric item

    Hi,
    For numeric fields, Oracle Forms checks the entry after the user tries to move out of the item.
    But, the requirement is to disable the typing of non-numeric keys when entering data in a numeric item.
    pls tell me how to achieve this..
    regards,
    Asim.

    Hi Asim,
    You can achieve this by using a PJC (or else you could try using some PL/SQL Code in the KEY-PRESSED Trigger or so.. but not sure).
    There is a demo available on OTN on how to achive this using PJC
    http://www.oracle.com/technology/sample_code/products/forms/index.html
    You could see a Key Filter demo under JavaBeans/PJC Samples (all available as part of the Forms demos).
    HTH.
    Regards,
    Arun

  • 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.

  • Regular Expression Numeric characters only

    Hi All,
    I'm trying to select just the numeric characters only. However, this regexpression returns data that also has a - in it or alpha characters, such as 58-69-30-008 NWSE. I don't want this.
    I just want rows with ONLY numeric data.
    WHERE servloc like '%[0-9]%'Thanks for your help,
    John

    LPS wrote:
    try this
    where regexp_like(servloc,'[0-9]');The above will return any servloc that has at least one digit. OP asked for "just the numeric characters only". Correct regexp_like would be:
    where regexp_like(servloc,'^[0-9]+$');Or:
    where regexp_like(servloc,'^\d+$');SY.

  • How do I find that, a column contains only numeric characters ?

    I want to search for all the column values which has some non numeric value.

    This should work: you'll need to adjust it if the column exceeds 10 characters. You also may need to add permitted non-numerical characters i.e. <space>, <comma>, <decimal point>, <minus sign>, etc.
    select col1
    from my_table
    where translate(col1, '1234567890' '**********') != substr('**********', 1, length(col1))rgds, APC

  • Find a non-numeric character in a string

    I have a 3 strings (1) 'AB99CDEFGH0012%' (2) 'ABCDEFGH' (3) 'ABCD11'
    how do i find out a that string has non numeric characters
    Thanks

    SELECT TO_NUMBER(:String) FROM DUAL;
    is a quick way to find out :)
    A good method would be.....
    SELECT 1 FROM DUAL WHERE TRANSLATE(:String, 1234567890, '-') IS NOT NULL;
    The statement will filter out ALL numbers, leaving behind any characters, A, B, @, ~, etc...

Maybe you are looking for

  • Number of records in SETUP table

    Hello I am working with PO extractor. Is the number of records in XXXXXXSETUP table equal to the number of records setup?

  • How to get program which is been processed in background

    Hi Experts,       While doing PI sheet (CO60) the document gets posted for movement type 101 in MIGO which is processed in background. I need know which standard program is processed to get the document posted in background.   The two function module

  • About inline function

    just tell me how we implement inline function which we are using in c++ in java just send me code

  • Podcast push on my iphone

    Hi there, I would like to get my podcast automatically uploaded (like mail push) on my iphone at a pre determined time of the day. I know it is possible to design a program using the itunes wifi sync tool, but i would like this program to run without

  • Updation in zip file through java program

    Hi, Can any buddy help me updating zip file using java programs. I dont want to delete the zip file but I want to update single file in the zip. Any clue ? Regards, Ashish