`
gaoke
  • 浏览: 83486 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

oracle 游标取值回顾

    博客分类:
  • DB
 
阅读更多

create or replace procedure testP is

 

  a varchar2(100);

  b varchar2(100);

  n_count number;

  TYPE MY_CUR IS REF CURSOR;

  c_count my_cur;

begin

  n_count := 0;

  open c_count for select scott.emp.ename , scott.emp.job from scott.emp where empno like '7%';

  fetch c_count into a,b;

  --while c_count%Found

  loop 

    exit when c_count%notfound;

    

    n_count:=n_count+1;

    dbms_output.put_line(n_count||'   a=='||a||'   b=='||b);

    fetch c_count into a,b;

    

  end loop;

 

  close c_count;

end testP;

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics