What I'd like to do is return results from function, so function could be used in following way:
select * from stuff(1)
Simplified function example:
FUNCTION stuff(p_var number) RETURN SYS_REFCURSOR
IS
CURSOR cur(cp_var number) IS
SELECT * FROM dual ;
BEGIN
OPEN cur(p_var);
RETURN cur;
END stuff;
But this this doesn't compile:
Error: PLS-00382: expression is of wrong type
Is it possible to return cursor/results from function, which is defined this way?