先复制一个原表
create table uco_8.testtable1231 as saddle.yuanbiao with no data;
编写存储过程
Create procedure testzss1()
begin
DECLARE I INTEGER DEFAULT 0;
DECLARE o_khbh CHAR(12);
loop_table:LOOP
SET I =I+1;
SET o_khbh =cast(I+10000 as VACHAR(12));
IF I>40000 THEN
LEAVE loop_table;
END IF;
Insert into uco_8.testtable1231(khbh)VALUES(:khbh);
end loop loop_table;
end;
执行存储过程
call testzss1();
造数完成后,删除存储过程
drop procedure testzss1();
可并行执行多个存储过程提升效率,在不同的tab页打开