国产九九热视频-国产九九精品视频-国产精自产拍久久久久久蜜-国产精自产拍久久久久久-国产精在线-国产精亚洲视频

Rss & SiteMap

曙海教育集團(tuán)論壇 http://www.bjzhda.cn

曙海教育集團(tuán)論壇
共1 條記錄, 每頁(yè)顯示 10 條, 頁(yè)簽: [1]
[瀏覽完整版]

標(biāo)題:Oracle PLSQL中用pro進(jìn)行 BULK COLLECT 的高效率查詢(xún)處理

1樓
wangxinxin 發(fā)表于:2010-12-11 11:09:53
過(guò)程樣例:
create or replace procedure real_user as
  c_count number(10);
begin

  DECLARE
    TYPE mobile_type IS TABLE OF mobile_dabenying.mobile%TYPE;  --按表字段類(lèi)型來(lái)定義變量類(lèi)型
    t_mobile mobile_type := mobile_type();
  
  BEGIN
    select mobile BULK COLLECT  --批量選擇數(shù)據(jù)
      INTO t_mobile
      from (select mobile from mobile_dabenying order by mobile);
  
    if (t_mobile.COUNT > 0) then
      FOR i IN t_mobile.FIRST .. t_mobile.LAST LOOP
      
        select count(*)  --從號(hào)段中過(guò)濾
          into c_count
          from mobile_region
         where t_mobile(i) between start_mobile and end_mobile;
      
        if (c_count > 0) then
          c_count := 0;
          insert into mobile_dabenying2 (mobile) values (t_mobile(i));  --真實(shí)用戶
        else
          dbms_output.put_line(t_mobile(i));
          insert into mobile_dabenying3 (mobile) values (t_mobile(i));  --假用戶
        end if;
      
      END LOOP;
    end if;
  
  END;

end;
共1 條記錄, 每頁(yè)顯示 10 條, 頁(yè)簽: [1]

Copyright © 2000 - 2009 曙海教育集團(tuán)
Powered By 曙海教育集團(tuán) Version 2.2
Processed in .01758 s, 2 queries.
主站蜘蛛池模板: 庆安县| 无极县| 东光县| 斗六市| 涞源县| 绥宁县| 太仆寺旗| 崇仁县| 秦皇岛市| 大石桥市| 咸阳市| 安国市| 克东县| 灵宝市| 宁远县| 青州市| 平南县| 台山市| 巴中市| 廉江市| 乌海市| 巴彦淖尔市| 龙州县| 周口市| 称多县| 高州市| 印江| 安阳县| 温宿县| 金平| 安徽省| 广东省| 揭西县| 岳普湖县| 阿荣旗| 东乌| 沂南县| 剑阁县| 新乡市| 苗栗市| 新密市|