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!

How to check if a number is a decimal number or a positive interger?

797687Oct 13 2010 — edited Oct 14 2010
Hello Everyone,

DB: 10g

Just wondering, if there is a way to check if data from a varchar2 column contains a positive interger. Example -
tab1
col1
1
3
1
4
5
2.3
bye
So, my code should accept all the values except 2.3 and bye. Once it get bye or 2.3, it should throw an
exception.

How to do it? Please advice.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 11 2010
Added on Oct 13 2010
5 comments
26,430 views