17,078
社区成员
发帖
与我相关
我的任务
分享
-- 定义游标
declare
cursor aa is
select names,num from test;
begin
for bb in aa
loop
if bb.names = "ORACLE" then
end if
end loop;
end
论坛里的例子:
create or replace procedure test is
cursor v_cur_6(ids varchar2) is
select * from T where instr(','||ids||',',','||to_char(A)||',')=0;
v_cur_line_6 v_cur_6%ROWTYPE;
begin
open v_cur_6('1,2');
loop
fetch v_cur_6 into v_cur_line_6;
exit when v_cur_6%notfound;
dbms_output.put_line('---------');
end loop;
close v_cur_6;
end;