日期:2014-05-16  浏览次数:20551 次

Oracle 循环插入数据 Demo

Oracle 循环插入数据  Demo:

declare

         maxnumber constant int:=1000;
         i int :=1;
     begin
         for i in 1..maxnumber loop
           insert into STUDENTINFORMATION("ID","NAME",SEX,ADDRESS,HOBBY)
            values(i,TO_CHAR('99'+i),'男','山东临沂','打篮球');
         end loop;
     dbms_output.put_line(' 成功录入数据! ');
     commit;

     end;


测试插入条数:select "COUNT"(id) FROM STUDENTINFORMATION;