postgre循环插入模拟数据
create or replace function batchInsert(endNumber bigint) returnsvoid AS $$declare ii integer;beginII:=1;FOR ii IN 1..endNumber LOOPinsertintos_config_log
·
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);
更多推荐
已为社区贡献2条内容
所有评论(0)