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

以文本方式查看主題

-  曙海教育集團(tuán)論壇  (http://www.hkzrsy.com/bbs/index.asp)
--  Oracle數(shù)據(jù)庫(kù)  (http://www.hkzrsy.com/bbs/list.asp?boardid=65)
----  Oracle PLSQL中用pro進(jìn)行 BULK COLLECT 的高效率查詢處理  (http://www.hkzrsy.com/bbs/dispbbs.asp?boardid=65&id=2506)

--  作者:wangxinxin
--  發(fā)布時(shí)間:2010-12-11 11:09:53
--  Oracle PLSQL中用pro進(jìn)行 BULK COLLECT 的高效率查詢處理
過(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)定義變量類型
    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;

主站蜘蛛池模板: 望江县| 南雄市| 怀远县| 册亨县| 西乡县| 高雄县| 广东省| 新丰县| 朝阳区| 乌拉特后旗| 神池县| 临猗县| 彰化市| 漳州市| 铜川市| 班戈县| 剑川县| 八宿县| 巴林右旗| 全椒县| 丹凤县| 海门市| 萝北县| 福贡县| 石首市| 湖州市| 大姚县| 宁夏| 岳普湖县| 桐梓县| 会东县| 宜春市| 鄄城县| 龙南县| 瑞安市| 麻阳| 通海县| 衢州市| 富阳市| 延川县| 大余县|