当前位置:Gxlcms >
数据库问题 >
Oracle PLSQL Demo - 09.Open、Fetch遍历游标[Open, Fetch, Close Record CURSOR]
Oracle PLSQL Demo - 09.Open、Fetch遍历游标[Open, Fetch, Close Record CURSOR]
时间:2021-07-01 10:21:17
帮助过:5人阅读
r_emp scott.emp%rowtype;
cursor cur_emp
is
select t.
* from scott.emp t;
begin
open cur_emp;
loop
fetch cur_emp
into r_emp;
exit when cur_emp
%notfound;
dbms_output.put_line(r_emp.empno || ‘ ‘ || r_emp.sal);
end loop;
close cur_emp;
end;
Oracle PLSQL Demo - 09.Open、Fetch遍历游标[Open, Fetch, Close Record CURSOR]
标签: