Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

best way to determine: string in numbers and > 0

WestDraytonMar 4 2010 — edited Mar 4 2010
What is the best way to determine, if input string (which is surely not null) is a positive whole number without comma, and bigger than zero.
The correct values are: 1,2,...,.

To determine if the string is a whole integer i can do this way:

select decode(REGEXP_INSTR ('1', '[^[:digit:]]'),0,'NUMBER','NOT_NUMBER') from dual;

But i don't know how to change the regular expression so that it would not allow zero to be first char.

Or is there any better way?
This post has been answered by MichaelS on Mar 4 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2010
Added on Mar 4 2010
11 comments
1,183 views