游标的使用,帮忙调下代码
CREATE OR REPLACE PROCEDURE PROC_STU2 AS
BEGIN
declare
cursor cur_stu is
select ename,sal from emp;
v_ename emp.ename %type;
v_sal emp.sal %type;
begin
open cur_stu;
fetch cur_stu into v_ename,v_sal;
loop
if cur_sru %found then
dbms_output.PUT_LINE(v_ename||'->'||v_sal);
fetch cur_stu into v_ename,v_sal;
else
exit;
end if;
end loop;
close cur_stu;
end;
END PROC_STU2;