Link to home
Start Free TrialLog in
Avatar of priyanka999kamlekar
priyanka999kamlekar

asked on

returning different datatype from a function Oracle PL/SQL

create FUNCTION myfunc
return VARCHAR2
is
v_ret NUMBER;
BEGIN
-- functionality which sets v_ret to -1 or (1/2/4/8)
return v_ret;
END myfunc;

My question is this v_ret will be converted to VARCHAR2 ? Will this create any issues in runtime.?
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of priyanka999kamlekar
priyanka999kamlekar

ASKER

Do you mean this?
i am calling this function myfunc in another function and storing the returned value in the NUMBER variable.

v_ret NUMBER;
v_ret := myfunc();

In this case what will happen?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A penalty grade is not appropriate here, I've requested moderator review
split among the 3 expert comments