--删除存储过程
drop procedure if exists copy_task_proc;
--创建
create procedure copy_task_proc(IN totalCount int)
begin
declare num int;
set num=1;
while num<=totalCount do
INSERT INTO fnd_company_b(company_id, company_code, company_type, address, company_level_id, parent_company_id, chief_position_id, start_date_active, end_date_active, company_short_name, company_full_name, zipcode, fax, phone, contact_person, OBJECT_VERSION_NUMBER, REQUEST_ID, PROGRAM_ID, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN)
VALUES(0, concat('company',num), '', '', 0, 0, 0, now(),now(), '', '', '', '', '', '', 0, 0, 0, 0, now(), 0, now(), 0);
set num=num+1;
end while;
end;
--调用
call copy_task_proc(2000000);