首页 > 数据库 > Oracle > 动态游标的操作~~~
--方法1
declare
cursor tmp_cur(tmp_num NUMBER) IS select * from tables where part_num=tmpnum;
begin
for emp_record in tmp_cur(123) loop
.......
.......
end loop;
end;
--方法2
declare
begin
for emp_record in (select * from tables where part_num=123) loop
.......
.......
end loop;
end;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/18921899/viewspace-1016714/ ,如需转载,请注明出处,否则将追究法律责任。