6 Star 72 Fork 28

JustryDeng / notebook

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
[20]PLSQL的游标.md 864 Bytes
一键复制 编辑 原始数据 按行查看 历史
邓沙利文 提交于 2022-03-30 11:02 . oracle相关知识点补充

PL/SQL的游标

示例

游标用法较固定,示例说明:

declare 
  v_xing student.studentname%type:='王';
  cursor stus is
         select * from student where studentname like v_xing||'%';
  v_stuobj student%rowtype;   
begin
  open stus;
  loop
   fetch stus into v_stuobj;
   exit when stus%notfound;
   dbms_output.put_line('学号:'||v_stuobj.studentno);
   dbms_output.put_line('性别:'||v_stuobj.sex);
   dbms_output.put_line('地址:'||v_stuobj.address);
   dbms_output.put_line('电话:'||v_stuobj.phone);
   dbms_output.put_line('电邮:'||v_stuobj.email); 
   dbms_output.put_line('--------------------------'); 
  end loop;
  close stus;
end;

游标的属性

1648606926149

1
https://gitee.com/JustryDeng/notebook.git
git@gitee.com:JustryDeng/notebook.git
JustryDeng
notebook
notebook
master

搜索帮助