Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: function to get only numbers
Hello Philippe,
why this code did not compile is already described in this folder but
why do you
skip through the hole string to get a valid number back ?
The second think : when you pass for ex. "10.2" you will get 102 as a
number
back ... is that OK for you ?
So here another function that do nearly the same but without skip through the hole string :)
Function CHAR2NUM_2(p_cVarchar VARCHAR2) RETURN NUMBER IS
nRet NUMBER;
BEGIN
nRet := TO_NUMBER(p_cVarchar);
RETURN nRet;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END;
This give back a 10.2 ...
I hope this will help you
Greetings
Manfred Peter
(Alligator Company)
www.alligatorsql.com
Received on Fri Jul 06 2001 - 06:50:35 CDT