create or replace procedure name_pro(p_id in varchar2)
as
cursor c1(v_id varchar2) is
select * from a where id=v_id;
begin
for v1 in c1(p_id) loop
....
end loop
...
as
cursor c1(v_id varchar2) is
select * from a where id=v_id;
begin
for v1 in c1(p_id) loop
....
end loop
...
AS
TYPE myrctype IS REF CURSOR;
END pkg_test;
/create or replace procedure name_pro(p_id in varchar2,p_rc out pkg_test.myrctype)
as
str varchar2(50);
begin
str:='select * from a where id='''||v_id||'''';
oper p_rc for str;
end;
/
关于游标,看pl/sql高级教程。