zhyiwww
          用平實(shí)的筆,記錄編程路上的點(diǎn)點(diǎn)滴滴………
          posts - 536,comments - 394,trackbacks - 0

          Oracle 循環(huán)插入測(cè)試數(shù)據(jù)(網(wǎng)上收集整理)

          ??????????????????????????????????????

          ??? declare
          ??????? maxrecords constant int:=1000;
          ??????? i int :=1;
          ??? begin
          ??????? for i in 1..maxrecords loop
          ????????? insert into UserInfo(UserID,login,password,firstName,lastName,ISADMINISTRATOR)
          ?????????? values(SYS_GUID(),TO_CHAR('9999'+i),'password','fristname','lastName','0');
          ??????? end loop;
          ??? dbms_output.put_line('
          成功錄入數(shù)據(jù)! ');
          ??? commit;
          ??? end;

          SYS_GUID()? 生成 GUID ORACLE

          NEWID?? 生成 GUID? SQLSERVERR

          declare

          定義部分標(biāo)識(shí)

          maxrecords constant int:=100;

          定義 maxrecords 為整型常量 100

          i int :=1;

          定義 i 為整型值變量,初值為 1

          Begin

          執(zhí)行部分標(biāo)識(shí)

          for i in 1..maxrecords loop

          i 1 循環(huán)到 maxrecords

          Insert into tempuser.testtable(recordnumber,currentdate) values (i,sysdate);

          向數(shù)據(jù)表中插入數(shù)據(jù)

          end loop;

          結(jié)束循環(huán)

          dbms_output.put_line(' 成功錄入數(shù)據(jù)! ');

          顯示成功錄入數(shù)據(jù)信息

          commit;

          提交結(jié)果

          end;

          結(jié)束執(zhí)行



          |----------------------------------------------------------------------------------------|
                                     版權(quán)聲明  版權(quán)所有 @zhyiwww
                      引用請(qǐng)注明來(lái)源 http://www.aygfsteel.com/zhyiwww   
          |----------------------------------------------------------------------------------------|
          posted on 2006-05-23 17:14 zhyiwww 閱讀(10037) 評(píng)論(8)  編輯  收藏 所屬分類(lèi): database

          FeedBack:
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)
          2006-08-04 11:31 | aa
          3Q
          頂....  回復(fù)  更多評(píng)論
            
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)[未登錄](méi)
          2007-01-21 15:21 | dingding
          謝謝
          正需要  回復(fù)  更多評(píng)論
            
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)
          2007-09-14 10:53 | tt
          begin
          for i in 1..1000 loop
          insert into test values(col1,col2,col3....);
          end loop;
          end;
          /
            回復(fù)  更多評(píng)論
            
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)
          2007-12-27 12:39 | coolrl
          不錯(cuò)  回復(fù)  更多評(píng)論
            
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)
          2008-03-06 09:32 | guoke
          錄到最大的數(shù)據(jù)后才提交,性能能好嗎?  回復(fù)  更多評(píng)論
            
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)
          2008-03-24 16:45 | www
          thank you !  回復(fù)  更多評(píng)論
            
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)[未登錄](méi)
          2008-09-18 22:11 | yy
          thank you  回復(fù)  更多評(píng)論
            
          # re: Oracle循環(huán)插入測(cè)試數(shù)據(jù)
          2009-02-25 16:29 | gli
          主站蜘蛛池模板: 司法| 嘉荫县| 左云县| 漯河市| 滨州市| 武邑县| 慈利县| 龙胜| 宁海县| 曲水县| 梁河县| 新民市| 扶沟县| 威信县| 云南省| 敖汉旗| 武安市| 通化县| 大港区| 榆中县| 武山县| 溆浦县| 公主岭市| 娄烦县| 罗江县| 乐亭县| 柘城县| 贡嘎县| 沂水县| 唐山市| 汤阴县| 江华| 罗甸县| 保定市| 南平市| 岚皋县| 涞水县| 吴忠市| 铜山县| 汉川市| 韩城市|