要点:for循环可以自动打开关闭游标,自动提取游标,而且还可以自动声明变量。
--for循环 带参数的游标
declare
cursor cur_pricetable(v_ownertype number) is select * from t_pricetable where ownertypeid=v_ownertype;--声明游标
begin
for v_pricetable in cur_pricetable(1)
loop
dbms_output.put_line('价格:'||v_pricetable.price||
' 吨位:'||v_pricetable.minnum||'-'||v_pricetable.maxnum);
end loop;
end;
博客提到for循环在数据库中的应用,它可自动打开关闭游标、自动提取游标,还能自动声明变量,涉及数据库相关信息技术。
621

被折叠的 条评论
为什么被折叠?



