for j in (select * from 表 where 条件) loop
处理过程;
end loop;
在过程中写如上的语句,因为where 条件需要根据传递的参数决定,需要动态的变化,不知 如果不使用包的话,在过程中能否实现此一写法?
create or replace procedure name_pro(p1 in number,p2 in varchar2)
as
cursor t_sor(v1 number,v2 varchar2) is
select * from 表 where col1_name=v1 and col2_name=v2;
begin
for v_sor in t_sor(p1,p2) loop
处理过程;
end loop;
end;
/