在循环中,我正在调用参数化游标。在任何特定步骤中,如果游标返回行,则此循环结束,我必须将游标作为参考游标返回。如何在不执行两次相同查询的情况下检查行数?
procedure pr_test
(
v_data varray;
,ret_data sys_refcursor
)
as
cursor c_q(x)
select * from table
where col1 = x;
...
begin
...
for in 1..v_data.count loop
open ret_data for c_q(v_data(i));
----- here some logic is required --------
/*if rowcount of re_data > 0 then
return ret_data;
else
close ret_data;
end if;*/
end loop;
end;