Evaluate value if numeric

HI,
is there a simple way to evaluate a value if it is numeric or not?
such that,
if is_numeric(v_val) then
return 'this is numeric';
else
return 'this is not numeric';
end if;thanks!
BROKEN

It kind of depends on what you are expecting to pass into it, and what you mean by "if it is numeric or not"
SQL> SELECT num, is_numeric(num)
  2  FROM (SELECT '1234.56' num FROM dual
  3        UNION ALL
  4        SELECT '1,234.56' FROM dual
  5        UNION ALL
  6        SELECT '-1234.56' FROM dual
  7        UNION ALL
  8        SELECT '12e3' FROM dual
  9        UNION ALL
10        SELECT '12a3' FROM dual);
NUM      IS_NUMERIC(NUM)
1234.56                1
1,234.56               0
-1234.56               1
12e3                   1
12a3                   0Is 1,234.56 numeric? How about 12e3? Is an IP address numeric by your definition?
HTH
John

Similar Messages

  • ORA-6502: value or numeric error

    Hi all,
    First off all, I am not very good in PL/SQL so please bear with me:
    I have a trigger on a table on after update event. Sample code of the trigger:
    create or replace trigger t1
    on table1
    after update of col1
    for each row
    begin
    for inx in varray1.first .. varray1.last
    loop
    do something;
    end loop;
    end;
    This trigger throws an error saying "ORA-6502: value or numeric error" if I am trying to update anything into that table but the same trigger works fine when I remove "FOR EACH ROW" statement from the trigger. There is absolutely no change except removal of FOR EACH ROW clause.
    I am unable to figure out why. Do anybody?
    Thanks in adnvace.

    Thanks a lot to all of you for taking time to answer my question.
    Again, let me rephrase my question in one single line:
    bold Why does the trigger without FOR EACH ROW works and doesnt work with FOR EACH ROW?
    What I am guessing is , it might be because of the array what we are using inside the trigger. But its just a guess. One more thing to note here, same code with and without FOR EACH ROW works when I am not using any arrays inside the trigger and thats what is the question. WHY cant same code works when used with FOR EACH ROW when arrays are used inside the trigger.
    I am not requesting anybody to write code for me or rectify the problems in the code. All I am interested in is the reason of trigger not working with FOR EACH ROW when arrays are used inside the trigger.
    Thanks

  • How to connect input string value to numerical values

    Hello,
    I am trying to figure out how to connect a single user's input string value to numerical values. Basically I want the user to input the name of a gas that I have a list for (I believe i put the list of gasses in an array>). Then I want to match 2 numerical values "a" and "b" depending on which gas name the user has put in. These "a" and "b" values will be automatically matched with the gas name from a list I put. For example the gas hydrogen has a value of 3 for "a" and 4 for "b. so when the user puts the name "hydrogen" in a string constant, automatically  "a" and "b" should be outputted. I will be connecting a and b to a formula
    Thanks for any help
    Solved!
    Go to Solution.

    student11 wrote:  These "a" and "b" values will be automatically matched with the gas name from a list I put. For example the gas hydrogen has a value of 3 for "a" and 4 for "b".
    This sounds a lot like an Enum to me.  Make sure you type def the enum to make sure updates quickly and easily make it to all copies of the enums.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Sort values in numeric order in drop down menu

    Is there anyway to sort the values in numeric order-asending for the drop down menu of a particular field.
    Any ideas?
    G

    Add a property 'SORTED' and Boolean = true in BPE.
    G

  • How to check value is numeric or not

    hi how to check whether a value is numeric or not.
    example.  data : x type n.
              x = 12345.
    Now how to check whether X contains numeric value or not.

    Hi,
         If your type is 'N' there is no way that 'X' can have any value apart for numberics (i.e. 0 - 9).
    You can also check that as follows.
    Data: num_list(10) type c value '0123456789',
          x type n.
    X = '12345'.
    This is more useful if your X is of type C.
    if X CO num_list.
    Its only numeric
    else.
    its contains non numeric
    endif.
    Regards,
    Sesh

  • How to replace the char values into numeric in my string?

    Hi Friends,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    I mean How to replace the char values into numeric in my string?
    Thanks,
    Sridhar

    Hi Sridhar,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    So, if i understand you correctly, you want to replace all characters in a string with 9 as in the above example, irrespective of position of the character, if so try with the below code.
    DATA: l_str TYPE string.
    l_str = 'ASKHSIUDNSBDKJSDH124312431243124saasdfsf'.
    REPLACE ALL OCCURRENCES OF REGEX '\D' IN l_str WITH '9'.
    IF sy-subrc EQ 0.
      WRITE: l_str. "Result will be 9999999999999999912431243124312499999999
    ENDIF.
    Regards,
    Chen
    Edited by: Chen K V on Jun 13, 2011 12:36 PM

  • Reinitiali​ze Default Value of Numeric control

    Hi all ,
         Is it possible to reinitialize default value of numeric Control while running labview ? 

    hi CsabaF,
    First of all
    i wants say for your Kindly reply ... 
    Your second Post Seems okay for me but it in my case i have loots of input controls
    i have added VI file as example (if i get some easy solution means no need to create config file process)  
    Attachments:
    Untitled 8.vi ‏10 KB

  • Null values in Numeric fields of Datasets

    I am wondering if anyone has run into this problem before and
    checking to see if anyone has an elegant solution.
    I have a rather large data set. (actually 5 of them on a
    single page) I am sorting certain columns in a table as numbers so
    i assign the variable " ds1.setColumnType("somenumbercolumn",
    "number")" In most cases Spry works great and it sorts by numbers
    properly. The problem is some of the fields in the XML file are
    null and I am trying to sort them as a number. Spry actually
    adjusts for this (as far as i can tell) and treats them like a 0
    which isn't exactly ideal considering there are real zero values in
    the data. I know spry doesn't currently format numbers:
    So here is my question. Does anyone one have a solution to
    fixing null values in a table so that it is still sortable but
    doesn't display a "0" and instead displays something like "--" or
    whatever. I have the option of editing the XML file as well, but I
    still need the table to sort by number.
    If not null values, how about non numeric fields which can
    still be sorted in a numeric column?

    Hi,
    We have an old post that raised a similar problem with yours.
    The post can be found
    here
    For you situation, you should add an if condition for the
    rows that have 0 and to add a custom string instead 0.
    for (var i = 0; i < numRows; i++)
    if(rows
    [ "field_name"] == 0)
    rows[ "field_name" ] = '--';
    Hope this helps you,
    Diana

  • Enter values from numeric indicator into corresponding cells of array

    Hi Friends.
    I have a doubt in arrays.
    I used WA Multiscale Peak detection.VI and coolected the location values in an array and subtracted the values using  Index array, like the first one with second and second one with third and so on.
    I inserted a numeric array at the output terminal of  "subtraction function".
    Is there a way to insert the values being displayed continuously in numeric indiactor, into an array?
    I tried doing it, but ended with an array were the values continuosly displayed in numeric indicator are being entered only in the first cell of the array.  
    Kindly help me.
    Good Day 

    Hi,
    As I dont have ASPT Toolkit installed, I dont have "WA Multiscale Peak detection.VI"... so I used simulated data.
    To resolve the issue, you need to do that calculation again in a loop... as soon below...!!
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    corresponding cells of array.vi ‏11 KB

  • Function to check whether a value is NUMERIC

    Hi
    I have a requirment, where I need to check for a field whether it contains a valid numeric value or not.
    Could you please suggest a function.
    If I use TO_NUMBER(VAL1) it throws an exception in case of an non_numeric value.
    The requirement is as follows.
    If the field 'val1' contains a numeric value then the function should return the coressponding nueric value. If it is not,then return a boolean value are a return code instead of exception.
    Is there are built in function in ORACLE to acheive the same , please advice.

    Hi,
    The best way to do it is using User Defined Function, i have written a function as per your Requirement...It is give the data if it is numeric else it will return FALSE
    create table Testdata
    as
    select '10' n from dual
    union all
    select 'xx' from dual
    union all
    select '20' from dual
    union all
    select '3YY' from dual;
    CREATE OR REPLACE FUNCTION IsNumeric
    (p_col_value IN VARCHAR2)
    RETURN     VARCHAR2
    AS
    v_val NUMBER;
    BEGIN
    v_val := TO_NUMBER (p_col_value);
    RETURN 'TRUE';
    EXCEPTION
    WHEN VALUE_ERROR THEN
              RETURN 'FALSE';
         WHEN OTHERS THEN
              RETURN 'FALSE';
    END IsNumeric;
    Select Decode(IsNumeric(n),'TRUE',n,'FALSE') from Testdata
    Regards
    kamal

  • Non numeric value in numeric field giving error

    Hi All
    I am using BAPI for creating sales order. If user is giving non numeric value in Quantity field it is giving error. Because quantity field data type is Double.
    Please Help.
    Thanks
    Raktim

    Hi Banerjee,
                 Create a String/int/long Context variable and point it to UI Input element.Do the validation  for correct input value. once the validation is succesful assign that value to RFC BigDecimal variable by Explicit casting.
    Hope this might solve your problem .
    Thanks
    Madhan

  • Java stored proc. malformed values in numeric Datafield ...

    The java stored procedure functiones well, if it access tables that are on the same server.
    Retrieving Data from numeric field of a resultset will result in malformed numeric values , if the table I access it on another server.
    like sms.tabname@server.
    No matter , which methods I use
    rset.getBigDecimal , rset.getFloat /these will retrieve sometimes values with 20 to 40 digits!.
    Maybe some NLS related problem ?

    Hi,
    Which RDBMS release/version are you using (and whish one is the target)?
    Kuassi, http://db360.blogspot.com

  • Default Value in Numeric Input Field in Visual Composer Application

    Hi All,
    I have developed a visual composer application which has a numeric input field for Hours.
    It is mapped to a backend module.
    We are using portal 7.31
    The problem is that the deafult value of this input field is "0", but the rquirement is to display as "0.0"
    The functionality has been tested with input values in decimals and works fine. The problem is when the screen first populates, that field should show "0.0" .
    Please advise.
    Thanks

    Hi Soumya Chanda,
    I don't know of an agreeable way around it. You could have a textual input, but then it doesn't have the numeric control behavior, plus you need to handle incorrect typing (alphanumeric notes).
    Sorry!

  • How do I set the Checkbox Export value to numeric?

    I am attemting to analyze the data in my forms.  In order to do so, I am exporting the data into a spreadsheet.  There are about 50 check boxes in the form that I am tabulating.  The default export values are "Yes" and "Off".  My preferred values are 1 and 0, which greatly simplify analysis of the data.  I can set the "Yes" value to "1", but I can't find a way to set the "Off" value to "0".  As it stands, I have to go through the list and delete all "Off" values to have them work in my spreadsheet.
    How do I create a numeric value on the check box?  Is there a more graceful way of analyzing data from forms?  Am I missing something.
    Here are some recommendations.  By default, make the checkbox export 1 and 0.  When the export value for  a checkbox is set to a numeric value, set the unchecked value to 0.  Provide a place to set the export value of an unchecked checkbox.

    You can't change the default "Off" value of a check-box. Just write a macro or script to replace all the instances of "Off" with "0". Shouldn't be too complicated... Another option is to use radio-buttons and set their values to 0 and 1. Set the "0" button as selected by default and you're guaranteed to get one of those values in your output (since it's not possible to "unselect" a radio-button group).
    Feature requests can be made here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • How do I add auto text based on value in numeric field?

    Need help... I'm trying to add auto text to a text field based on a value in a numeric field. I want my text field (summary box) to say "Passed" if the value (score box) is equal to 10 and the field to say "Not Passed" if the value is equal to less than 10. My numeric field is being calculated by selecting drop-down lists.
    Thanks in advance for your help.
    Ed Watson
    Here's a link to the document I created...
    https://files.acrobat.com/?trackingid=KGLIT#folder/c3106c32-2e69-4a5f-8ef2-94d25623dbfb

    I think I figured it out.  I used the following script:
    if(NumericField1.rawValue ==1){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==2){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==3){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==4){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==5){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==6){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==7){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==8){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==9){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==10){TextField1.rawValue = "Passed"}
    There's probably a cleaner way to do the same thing but at least this works for now.  Hope this helps someone else.

Maybe you are looking for

  • Can't update iTunes Match after upgrading to 11.1.5

    Hi, Is anyone else (in Australia) having problems with iTunes Match after upgrading to iTunes 11.1.5 on Mac? I've found that whenever I play a track (i.e. update the play count), set a rating or edit a playlist, all my cloud songs become greyed out,

  • IE Issue Using Vertical Menu

    I wonder whether someone can help me. I have used spry menu in dreamweaver and works ok in Safari and Firefox however in IE 7 the menu appears in two lines. You can see this on www.sancere.com/index and also when you click onto Asian weddings. Is the

  • Shift Planning (PP61) in SAP. How to automate the process of entering  data

    Hi Friends, With using PP61 tcode we can able to enter data manually. I want to upload data from excel file. Is there any automation process? like any programs are function modules will useful? Many thanks in advance for the solution.

  • [AS,CS3] Crouching tiger hidden feature (nearly)

    Learning to use InDesign at the same time as learning to script it. Never  have been much for setting next styles in paragraph styles, but was impressed on trying out the feature when a range of paragraphs are selected of holding down the control key

  • No Scroll bar with JTextArea on unix machine

    hi am using JTextArea with Unix machine... The problem is not enabling scroll bars can anyone help me