存储过程批量插入
-- 如果存在同名的存储过程则删除
DROP PROCEDURE
IF EXISTS proc_batch_insert;
-- 创建存储过程
CREATE PROCEDURE proc_batch_insert ()
BEGIN
DECLARE i INT;
SET i = 1;
WHILE i < 1500000 DO
INSERT INTO mt_plan_wbs_template (
`ID`,
`FD_TEMP_CODE`,
`FD_TEMP_NAME`,
`FD_CODE`,
`FD_NAME`,
`FD_ID_CODE`,
`FD_LEVEL`,
`FD_PARENT_CODE`,
`FD_HIER`,
`FD_CAN_HOOK`,
`FD_ITEM_CODE`,
`FD_CATALOG_APPEND`
)
VALUES
(
UUID(),
'111500100001',
'1000kV荆门特高压变电站扩建工程首层WBS',
'1115001000010120000000',
'1000kV荆门特高压变电站扩建工程首层WBS',
'0120000000',
'1',
NULL,
'-1115001000010120000000-',
NULL,
'11150010000101',
'X'
);
SET i = i + 1;
END
WHILE;
END;
-- 调用存储过程
CALL proc_batch_insert ();