Here are three slightly different versions of what you might be looking for.
CREATE OR REPLACE FUNCTION isnum (thestring IN VARCHAR2)
RETURN BOOLEAN
IS
holder NUMBER;
BEGIN
holder := TO_NUMBER(thestring);
RETURN TRUE;
EXCEPTION
WHEN OTHERS
THEN
RETURN FALSE;
END;
/
That
Hello gurus,
Could someone tell me the best way to check a string to ensure that it
contains all numeric digits before converting it to a number with to_number?
I don't see a function like ISNUM.
TIA,
Woody
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Woody