当前位置: 代码迷 >> Oracle开发 >> ▲▲▲用过PL/SQL(存储过程及游标)的人进来▲▲▲解决方法
  详细解决方案

▲▲▲用过PL/SQL(存储过程及游标)的人进来▲▲▲解决方法

热度:54   发布时间:2016-04-24 07:46:14.0
▲▲▲用过PL/SQL(存储过程及游标)的人进来▲▲▲
declare  
    type   cursorType   is   ref   cursor;    
    v_cur   cursorType;
begin
    getemps(v_cur);
    /*各位朋友,我想在这个位置,循环取出游标中的值,请问如何写?*/
end;

其中过程getemps代码如下
  create   or   replace   procedure   getemps(   p_cursor   in   out   types.cursorType   )    
    as    
    begin    
                open   p_cursor   for   select   id,   title   from   cf_news   order   by   id;--表的名字    
    end;

------解决方案--------------------
声明v_id,v_title,再加
LOOP
FETCH v_cur INTO v_id,v_title;
EXIT WHEN v_cur%NOTFOUND;

------解决方案--------------------
fetch
  相关解决方案