declare
v_sql varchar2(2000);
–type cur_type is ref sys_refcursor; –PLS-00103: Encountered the symbol "SYS_REFCURSOR" when expecting one of the following: cursor
–v_out cur_type;
v_out sys_refcursor;
–v_row v_out%rowtype; –PLS-00320: the declaration of the type of this expression is incomplete or malformed
v_row emp%rowtype;
begin
v_sql := 'select * from emp where empno <= :1';
open v_out for v_sql using 7799;
loop
exit when v_out%notfound;
fetch v_out into v_row;
dbms_output.put_line(v_row.empno || ':' || v_row.ename);
end loop;
close v_out;
dbms_output.put_line('#########################################');
v_sql := 'select * from emp where empno <= :1';
open v_out for v_sql using 7698;
loop
exit when v_out%notfound;
fetch v_out into v_row;
dbms_output.put_line(v_row.empno || ':' || v_row.ename);
end loop;
close v_out;
end;