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

oracle循环插入数据函数

declare
i integer;
j integer;
begin
? i := 1;
? j := 0;
? while i < 500000 loop
??????? insert into t_company(id,
????????????????????????????? name,
????????????????????????????? address,
????????????????????????????? telephone,
????????????????????????????? fax,
????????????????????????????? contact_name,
????????????????????????????? position,
????????????????????????????? contact_phone,
????????????????????????????? contact_mobile,
????????????????????????????? email_address,
????????????????????????????? type,
????????????????????????????? is_maintenance)
???????????????????????????? values
???????????????????????????? (generator.nextval,
???????????????????????????? to_char(i),
????????????????????????????? 'address',
????????????????????????????? '2028888',
????????????????????????????? '202-888',
????????????????????????????? 'contact_name',
?????????????????????????????? 'position',
???????????????????????????? '135399',
????????????????????????????? '136028',
????????????????????????????? '123@abc',
????????????????????????????? '1',
????????????????????????????? '1');
?????????????????????????????
???????????????????????????? i := i + 1;
???????????????????????????? j:= j + 1;
???????????????????????????? if(j>=2000) then
?????????????????????????????? commit;
?????????????????????????????? j:=0;
???????????????????????????? end if;
? end loop;
? commit;
end;