• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
gooliugle
博客园    首页    新随笔    联系   管理    订阅  订阅
Oracle--存储过程

1、存储过程写法

create or replace procedure HVM_BYQ_TJ

--变压器统计信息--->入库
(id in number)
as
begin
  for num in 1..2 loop
  if num=1 then
  update hvm_zsb_tj set byq=(select count(0) as hangshu from hvm_view_ObjectZTPJ_Byq t where t.StsRes = '正常状态' and t.bdzdydj = '500kV') where id=1;
  end if;
  if num=2 then
    update hvm_zsb_tj set byq=(select count(0) as hangshu from hvm_view_ObjectZTPJ_Byq t where t.StsRes = '注意状态' and t.bdzdydj = '500kV') where id=2;
  end if;
  end loop;

end HVM_BYQ_TJ;

2、调用

call  HVM_BYQ_TJ(1);

posted on 2010-09-15 09:45  gooliugle  阅读(689)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3