Lets say I have 2 functions: get_emp_ids
and get_emp_details
on my employees
table. The get_emp_ids
function returns a refcursor
containing the ids of the employees. This will be function that will be frequently called in other procedures/functions.
get_emp_ids
is something like this:
open id_cursor for
select id from employees where some_complex_logic based on input_parameters;
...
return id_cursor
get_emp_details
will internally call get_emp_ids
something like this:
select get_emp_ids(input_parameters, id_cursor);
open result_cursor for
select name, age, manager, title from employees where id in id_cursor;
...
return result_cursor
What is the correct way to write the where
conditionget_emp_details
PS – Both of the functions will have the same input parameters.
I have tried using FETCH
AND other similar options but I am getting syntax error.