create or replace function batchInsert(endNumber bigint) returns 
 void AS $$
 declare ii integer;
   begin
   II:=1;
   FOR ii IN 1..endNumber LOOP
     
    insert 
    into
        s_config_log
        (sub_sys_code, sub_sys_name, module_type_code, module_type_name,  log_content, create_time, user_id, username, login_addr) 
    values
        (1048576,'基础应用', 1024, '组织配置', '删除控制中心:XXXXXXXXXXXXXXXXXXXX', '2015-01-28 17:24:19', 4, 'admin', '10.10.10.10');
   end loop;
   end;
 $$ LANGUAGE plpgsql;
 
select batchInsert(1000);

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐