best way to find out: string in number and > 0

What is the best way to determine whether the input string (which is surely not null) is a whole number greater than zero and positive without a comma.
The correct values are: 1, 2,...,

To determine if the string is a whole number, I can do this way:

Select decode (REGEXP_INSTR ('1 ',' [^ [: digit:]]'), 0, 'NUMBER', 'NOT_NUMBER') of double;

But I do not know how to change the regular expression so that it would fail to zero to be the first tank.

Or is there a better way?
SQL> with t as (select '-1' s from dual
           union all
           select '0' from dual
           union all
           select '109' from dual
           union all
           select '0109' from dual
           union all
           select '1.5' from dual)
select t.s, case when regexp_like (s, '^[1-9]+[0-9]*$') then 'NUMBER' else 'NOT A NUMBER' end test
from t
/
S    TEST
---- ------------
-1   NOT A NUMBER
0    NOT A NUMBER
109  NUMBER
0109 NOT A NUMBER
1.5  NOT A NUMBER

5 rows selected.

Tags: Database

Similar Questions

  • What is the way to find out which app is downloading data from the internet?

    Every time I connect to internet, I see that nearly 100 MB of data is is downloaded, without my consent. I did almost all the applications that I know to ask my permission before you download.

    Yet, some applications are downloading data without my consent.
    I would like to know what are the applications that do.

    What is the way to find out which app is downloading data from the internet?

    There is background applications that automatically transfer and receive data when the computer is connected to the internet. Try if there is active apps running.

    1. click Alt + Ctrl + Del to go to start Task Manager / Applications and end unnecessary tasks.

    2. go in Control Panel / programs / uninstall a program and uninstall unwanted programs.

    I hope this helps.

  • Best way to find a job

    Hi all

    I want to find a job that is running in cron every day... What is the best way to find this job. Is there a way that we can put ourselves in the database with identification work and every time when this work is performed will automatically trace?

    Thank you

    Nishant Santhan wrote:
    Hi all

    I want to find a job that is running in cron every day... What is the best way to find this job. Is there a way that we can put ourselves in the database with identification work and every time when this work is performed will automatically trace?

    Thank you

    Hello

    Since it's from cron, you can add a line in your script to trace it.
    It generates the trace file to the location of the user dump.

    alter session set sql_trace=true
    

    Concerning
    Anurag

  • What is the best way to obtain a string that represents a date in the format mm/dd/yyyy

    What is the best way to obtain a string that represents a date in the format mm/dd/yyyy

    It would be good if I could generate this string using the static methods of a class.






    You can use date formatter:

    Import mx.formatters.DateFormatter;
    ...

    var trainer: DateFormatter = new DateFormatter();
    formatter.formatString = "YYYY/MM/DD JJ:NN:SS;
    var today: Date = new Date();
    trace (formatter.format (now));

  • best way to find the maximum value that is less than a specific value?

    Hello guys,.

    What is the fastest way to find a record that has value max of a field and there is a limitation to a specific value for ex:

    example 1:
    create table dummy(master_id number, detail_id number, some_value varchar2(80));
     
    insert into dummy values (1,1,'bla bla1');
    insert into dummy values (1,2,'bla bla2');
    insert into dummy values (1,3,'bla bla3');
    insert into dummy values (2,1,'bla bla4');
    insert into dummy values (2,2,'bla bla5');
    insert into dummy values (2,3,'bla bla6');
    insert into dummy values (2,4,'bla bla7');
    commit;
    I want to get:
    1 3 bla bla3
    2 4 bla bla7
    And these applications give a correct result:
    Select * 
    from   dummy d1
    where  detail_id = (select max(detail_id) from dummy d2 where d2.master_id = d1.master_id);
     
    OR next one which i prefered.
     
    Select *
    From   (Select d1.* , row_number() over(partition by master_id order by detail_id desc) r
            from   dummy d1)
    Where  r = 1;
    If these solutions are enough or is there a better way?

    Edited by: elcaro on 13.Ara.2011 04:02

    Edited by: elcaro on 14.Ara.2011 04:31

    Please try this with your new test tables:

    select m.master_id,
           m.master_data,
           max(d.id) keep (dense_rank last order by data_value, d.id) d_id,
           max(d.master_id)  keep (dense_rank last order by data_value, d.id) d_master_id,
           max(data_value) keep (dense_rank last order by data_value, d.id) d_data_value,
           max(date_data)  keep (dense_rank last order by data_value, d.id) d_date_data
    from master_dummy m, detail_dummy d
    where m.master_id=d.master_id
    and d.date_data <= to_timestamp('04012010','ddmmyyyy')
    group by m.master_id, m.master_data
    

    Published by: hm on 14.12.2011 05:18

    (I added d.id column in the order by the dense_rank. clause that could make a difference when there is more than one line with the same data_value).

  • What is the best way to back up your iTunes library and playlists

    I'm looking for the best way back up my library iTunes and Playlists.  I will probably support him until a spare flash drive.  Is there a step by step procedure out there that I can follow to make the back upward?

    Drag the iTunes folder in your folder music on the backup drive.

  • NB550D - best way to install Win 7 64-bit and 64-bit drivers

    Hello

    I improved my NB550D to Windows7 Home Premium and installed 4 GB of RAM.
    This works much better, but want to go further and make a Windows7 Ultimate _64bit_ _clean install_ in order to take full advantage of theupgrade in RAM.

    My question is: what should I do about the Toshiba drivers for 64-bit? I guess I'm going to need some?

    What is the best way to go about the upgrade - any help will be appreciated! : D

    If you need to switch to Win 7 64 bit, then you need some Win 7 64 bit drivers.
    On the European driver Toshiba page, I could find some 64-bit drivers, but it seems that not all Toshiba for Win 7 64-bit tools are released.

    Drivers for WLan or BT stack can be found here:
    http://APS2.toshiba-tro.de/WLAN/
    http://APS2.toshiba-tro.de/Bluetooth/

    Other drivers or Toshiba tools such as value added package or Face Recognition, Eco utility and others could be used with other series of portable for example by Satellite C660D or others such as L750D, L755D or C670D
    Surely you must pay attention to the integrated graphics chip, the LAN or the chipset
    Use the drivers that are released for fleas in NB550D

  • I got my wife a new iphone 6 and I'm going to use his old iphone 6. What is the best way to remove his contacts/music/etc. and mine install on old phone?

    Wouldn't be better to do a full restore to old phone via itunes?  And then his 'old' connection phone to my macbook and install my info to the Cloud?  What is the best way to do it?

    Follow the procedures described in: what to do before you sell or give away your iPhone, iPad or iPod touch - Apple Support

    To get your content on the phone: restore your device from an iCloud or iTunes backup - Apple Support

  • What is the best way to save an array of objects and then load it?

    Hi, what is the best way to save and load an array of objects?

    I hade a code like that, but it does not work:

    var test = new Array();
    test.push(new Foo("a"));
    for (var i = 0; i < test.length; i++) {
        console.log(test[i]);
    }
    // save and load, then show again
    localStorage.setItem("test", test);
    var test2 = localStorage("test");
    for (var i = 0; i < test2.length; i++) {
        console.log(test2[i]);
    }
    

    the problem is, the first newspaper that get the things I want. The second time I get:

    Uncaught TypeError: Property 'localStorage' of object [object Object] is not a function
    

    The work around this problem is to stringify before saving and then analyze before loading.

    http://StackOverflow.com/a/2010948/773263

    Although I said, it is better to use IndexDB.

  • The best way to make your own lens flares and light highlights/streaks

    I have not money for Knoll Light factory lens flares so I need to make my own flares, splinters, highlights and streaks.  Anyone has any advice on the best way to do it.  Or is there somewhere a tutorial on it.

    Thanks in advance.

    With CS4 production premium on a Mac

    Classic: http://aestuff.myleniumstuff.de/?p=7

    Aside from that, you can generate a lot of light and reflections by stacking multiple effects and working with duplicates of the layer - extract the highlights using levels or threshold, apply the directional blur etc., coloring with Ting, Tritone or Colorama, apply a layer of mixture of modes to the source...

    Mylenium

  • Best way to edit on a white background and a transparent gif

    I have a picture that I bought, but need to make a gif. He already has a white background, but when I use the magic wand he has chopped bits of the edge of the image.

    Is there an easier way of white out of this editing context and make a transparent gif?

    I use Adobe Photoshop CS2

    Image is attached to take a peek.

    Thanks, I appreciate help with this.

    Nick

    Set the magic wand tool to have a tolerance of 0 and contiguous selected and click on the background. Is it as pure white then it should select it, if not then click some more or increase the tolerance value a little bit.

  • How to find the string of TextFrame and replace (CS3)

    I want to search the textFrame chain after that I want to replace it. How to do in CS3. can someone tell me.

    Search / replace is a single operation. Unless for a particular situation, you don't have to search first. (By the way, if you do search for first and store the results, they will no longer valid after the change.)

    Management texts related support 'findText' and 'changeText' methods, so this code snippet

    app.findTextPreferences = null;
    app.findTextPreferences.findWhat = 'something';
    app.changeTextPreferences.changeTo = 'something';
    Alert ("this is a" + app.selection [0].constructor.name ' ");
    App.Selection [0] .changeText ();

    works fine if you select a block of text and run.

  • Best way to parse a string for use in a lookup table?

    I am trying to create a system by which users can create a premade simulation and store simulations in order to easily load at their convenience. The way it works now is that when the user creates a simulation, information on the characteristics of the simulation are condensed down to a 12 string, which is written in a text file with the same name as its content. This string is then read, and ideally, I would have some sort of lookup table to convert characters in the information they have been condensed to. For example, a variable X can have possible values {650,720,851} who gets the mapping to {A, B, C} during the creation process. When loading, I would be able to send in a Sub C - VI and took her out in 851, group in a cluster. How can I perfectly realize this in LV? So far the best I have is this messy thing:

    Basically, who runs the string character by character and includes the appropriate value for the character at the given offset.

    You want to use the configuration VI palette.

    These screws makes it stupid simple save and load the values in the file by using Sections and keys.

    You can use the keys 'A', 'B' or 'C' and section 'X' to complete your example.

  • The best way to find the name of the installed application module?

    If you don't know the name of an application module, how can you find it?

    For example, if I have the name of jad file from another application, can I assume that the name of the application module is basename of the jad?  As in, a name of jad MyApp.jad would result in a module name to 'MyApp '?

    That was my assumption in a first time, and it of that he seems to be the case, most of the time, but not all.  In particular, if the jad's name:

    MyApp - 1.0.0.jad

    I found that the name of the actual module on a "BOLD" v4.6.167 running (and the 4.6.0 JDE the bold Simulator) is

    MyApp$ 2 d 1

    However, * on an another "BOLD" * (this a v4.6.0.162 running), the exact same application indicates a module name of

    $ 2 d $1 2e0 MyApp$ 2e0

    That's why I wonder if there is way to get more definitive an application module.  I scoured the API documentation and the solution isn't jumping home.

    Thoughts?

    Thanks for any help.

    Ah.  I can also see if I need to 'escape' my module names.  If this isn't the case, then I can watch an exact match in the list of module names.  If I have, it seems that I still need to look for something, "close enough" and hope for the best.

  • Find the alteast a number and a character in the given string

    Hi all

    How to find the given input string, it contains at least one alpha and one number.
    My test like this data

    test123-> pass
    test-> Fail
    123Test-pass
    123 > fail

    select * from dual where regexp_like ('test123','[0-9]')

    If it closes your questions, so please mark the thread as an answer.

Maybe you are looking for

  • The mouse cursor disappears when iTunes movie go full screen

    This isn't a question... actually I found a hack solution to this bug and I wanted to share it with other people having the same problem. Since the upgrade of the OS X El Capitan, I'm having a problem with my cursor disappears randomly. It is very re

  • SatelliteA300: standby or hibernation fails with cable connected network

    I can't get my laptop to stay in standby or Hibernate for more than a minute, unless I have remove the cable from router.All programs have been arrested everything first, no other viruses have been detected or other unexpected behavior.Can someone ad

  • Motorcycle apps is not supported on play store on XT1524

    The apps - motorcycle, motorcycle display, shares of motorcycle bike and bike assist - are appearing not supported by this device on the game store (with the exception of the "hub" app motorcycle...) ... Is there a fix? They seem to work well and are

  • How do you "break" a track playback

    I want to be able to make a break all the tracks at once in the middle of a song so I can do a James Brown type thing where the entire band "hits" at some point, in the heat of the Groove, etc.. All I can find is the Play/Stop buttons in mapping of p

  • Built app crashes instantly

    I am building an application in Labview 2010 Professional (upgrade to the latest patch, f4) The application is built successfully, but when I run my application built, it crashes instantly (on the same computer, I built it on) declaration of an accid