日期:2014-05-17 浏览次数:20825 次
declare cursor e is select * from emp ; e_row emp%rowtype; begin open e ; loop --用这种方式可以 exit when e%notfound; fetch e into e_row ; dbms_output.put_line( rpad(e_row.ename , 15 , ' ') || ' ' || e_row.sal); end loop; close e; end;
declare cursor e is select * from emp ; e_row emp%rowtype; begin open e ; while e%found loop --这种方式就没用,控制台不打印 fetch e into e_row ; dbms_output.put_line( rpad(e_row.ename , 15 , ' ') || ' ' || e_row.sal); end loop; close e; end;