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_numeric function

user10647455Dec 3 2008 — edited Dec 4 2008
Hi guys
I have a small issue i n the function i am writing...
i have to write a function which evalutes the numeric value also the nulls
if my data column has number in it then this is TRUE in my case
while others are false
but when i am writing this m getting error as function returend no values.

CREATE OR REPLACE FUNCTION IS_NUMERIC( str IN VARCHAR2 )
RETURN NUMBER
IS
NUM NUMBER;
BEGIN
NUM := TO_NUMBER(str);
IF NUM is not null then
RETURN 0;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN 1;
END;

thanks

Edited by: user10647455 on Dec 3, 2008 1:59 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2009
Added on Dec 3 2008
7 comments
3,518 views