设为首页 加入收藏

TOP

Oracle数据库游标案例讲解与源码(二)
2015-11-21 03:26:59 来源: 作者: 【 】 浏览:84
Tags:Oracle 数据库 游标 案例 讲解 源码
合条件的数据,共'||cur_prdt_catg%rowcount||'条'); exit; end if; end loop; commit; --转换产品类型 open cur_catg; tmpnum:=0; loop fetch cur_catg into v_cid,v_cname; if cur_catg%found then update productinfo_tmp set productinfo_tmp.category=v_cname where category=v_cid; if sql%found then tmpnum:=tmpnum+sql%rowcount; end if; else dbms_output.put_line('产品类型转换完毕,共转换'||tmpnum||'条'); exit; end if; end loop; --产品价格下调 update productinfo_tmp set productinfo_tmp.price=productinfo_tmp.price*0.95 where productinfo_tmp.price>2000; dbms_output.put_line('产品价格更改完毕,共更改'||sql%rowcount||'条'); commit; end;
执行效果图:

\

代码图:


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇ORA-01688错误解决 下一篇导入表数据 txt

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: