Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > PL/SQL中的 for Update of 应用一例
【标  题】:PL/SQL中的 for Update of 应用一例
【关键字】:PL/SQL,for,Update,of
【来  源】:http://blog.csdn.net/precipitant/archive/2007/04/18/1569681.aspx

PL/SQL中的 for Update of 应用一例

Your Ad Here

  for update 是为当前的查询加锁。利用这种方式可以大大的提高效率。下面的一个例子中利用有 for update of 的 游标更新数据。当然具体效率的提升情况需要用大数据量的处理来测试才能得出来。

 

 

declare

cursor gData(var1 varchar2is select item_name,item_name_en,code_value from y0411 where item_name=var1 for update of code_value;
rs gData
%rowtype;
begin
  
open gData('钢管');
  loop
     
fetch gData into rs;
     
exit when gData%notfound;
         
if rs.item_name='铝型材' then
            
update y0411 set code_value='northsnow' Where Current Of gData;
         
else
            
update y0411 set code_value='塞北的雪' Where Current Of gData;
         
end if;
  
  
end loop;
  
close gData;
end;

 

执行SQL语句报ORA-00600 错误的解决:【上一篇】
Mysql分区?:【下一篇】
【相关文章】
  • [Python]在cygwin下编译MySQLdb for python
  • Cannot forward after response has been committed
  • Development tools for C++ on Linux development environment
  • 架构师任务--制定代码规范(standard of Coding Standards)
  • 菜单的扩展性 ( 以下内容适用平台 Microsoft Windows CE 5.0 )
  • Oracle数据库PL/SQL编码规则总结
  • DotNET WinForm FAQ 16个 (转)
  • 强制退出WinForm程序之Application.Exit和Environment.Eixt
  • DotNET WinForm 16个基本知识点(下)
  • Microsoft SilverLight横空出世
  • 【随机文章】
  • 博客堂2007年度"不谈技术"年会
  • 在文件的头部插入行的方法
  • 两个可用于webshell提权的EXP和1个内部版06040的EXP
  • [转贴]truncate,delete,drop的异同点
  • 值得重视的Comparable接口
  • 《 中国黑客致中国黑客和红客的公开信 》
  • VMware 发布免费的服务器软件
  • DHTML技巧--网页文字选取
  • 最新“购买意向调查”结果出炉
  • New mail server (debian + exim4 + dovecot IMAP)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.