declare cursor cemp is select ename,sal from emp; pname emp.ename%type; psal emp.sal%type; begin open cemp; while cemp%found loop fetch cemp into pname,psal; dbms_output.put_line(pname||'的薪水是'||psal); end loop; close cemp; end; 哪里错啦?
while cemp%found loop ,如果不fetch的话,永远进入不了循环。