I have a bunch of functions with signatures like:
FUNCTION func1 (par1 IN VARCHAR2, par2 IN NUMBER) RETURN my_rec;
and I have a function for retrieving data from this bunch of functions:
FUNCTION get_result (func_name IN VARCHAR2, par1 IN VARCHAR2, par2 IN NUMBER) RETURN my_rec;
IS
rec1 my_rec;
BEGIN
EXECUTE IMMEDIATE 'SELECT ' || func_name || '(:par1, :par2) FROM DUAL'
INTO rec1
USING IN par1, IN par2;
RETURN rec1;
END;
but this code fails with ORA-01007 'variable not in select list'.
How can I rewrite statement?