Oracle 学习----游标(使用无参光标cursor)

表:

 

----游标-----------------------------

declare
  cursor tt is select name,sal from temp;
  vname temp.name%type;
  vsal temp.sal%type;
begin
  open tt;
  loop
    fetch tt into vname,vsal;
    exit when tt%notfound;
    dbms_output.put_line(vname||'-----'||vsal);
  end loop;
  close tt;
end;
/

 

posted @ 2019-04-09 10:41  阿Q啊  阅读(331)  评论(0编辑  收藏  举报