开发者

create ref curser with parameters?

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜