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!

Is there a built-in function to check if a string is a number?

407338Jul 29 2010 — edited Jul 29 2010
Hi all,
In Oracle, is there a built-in function that checks if a string (varchar2) is a number? So far I have not found one and I may have missed it in the documents, so I have had to use a block like
begin
v_number := to_number(v_string);
exception when others then
v_number := 0;
end;
if v_number > 0 then
....
end if;

Thank you.

Ben
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2010
Added on Jul 29 2010
10 comments
1,700 views