how can I create ref curser with parameters and return this cursor from plsql function? I tried to write something like this code..
create or replace function get_ref_cur(id in number) return sys_refcursor is
ref_curs sys_refcursor;
begin
open ref_curs(std开发者_StackOverflow中文版_id number) for select * from student where id = std_id;
return ref_curs;
end;
but this code did not work.
You shouldn't need to apply parameters to a plain sys_refcursor.
create or replace function get_ref_cur(id in number) return sys_refcursor is
ref_curs sys_refcursor;
begin
open ref_curs for select * from student where std_id = id;
return ref_curs;
end;
精彩评论