I need to transform a string into a number using some oracle built-in methods (parsing, strlength, ...)
I don't know how to assign a value to a variable inside the method, and I don't know where to put the declare section.
CREATE OR REPLACE FUNCTION EXAMPLE (param IN VARCHAR2)
RETURN NUMBER AS
BEGIN
SELECT <string_handling_using_param>
INTO var
FROM DUAL;
RETURN TO_NUMBER(<some computation using var>);
END EXAMPLE ;
I have tried some variation around this function, like adding an OUT parameter for storing the intermediate var, but then I can not call the function from regular SQL...
Any suggestion on how to achieve this ?