declare --强类型的游标类型 type strong_cursor_type is ref cursor return emp%rowtype; --弱类型的游标类型 type weak_cursor_type is ref cursor; --变量定义 strong_cursor strong_cursor_type; weak_cursor weak_cursor_type; v_emp emp%rowtype; begin open strong_cursor for select * from emp; loop fetch strong_cursor into v_emp; exit when strong_cursor%notfound; dbms_output.put_line(v_emp.empno || '-' || v_emp.ename); end loop; close strong_cursor; open weak_cursor for '&sql'; loop fetch weak_cursor into v_emp; exit when weak_cursor%notfound; dbms_output.put_line(v_emp.empno || '-' || v_emp.ename); end loop; close weak_cursor; end;
版权声明:
本文来源网络,所有图片文章版权属于原作者,如有侵权,联系删除。
本文网址:https://www.mushiming.com/mjsbk/11877.html