//create procedure statement
delimiter $$ use db $$ drop procedure if exists insertIntoT1Table; create procedure insertIntoT1Table(in num int) begin declare i int default 1; while(i<num) do insert into t1(name,abstract,author,content,summary) values(uuid(),uuid(),uuid(),uuid(),uuid()); set i=i+1; end while; end $$
call procedure
call insertIntoT1Table(100);
show create procedure insertIntoT1Table \G; *************************** 1. row *************************** Procedure: insertIntoT1Table sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION Create Procedure: CREATE DEFINER=`root`@`localhost` PROCEDURE `insertIntoT1Table`(in num int) begin declare i int default 1; while(i<num) do insert into t1(name,abstract,author,content,summary) values(uuid(),uuid(),uuid(),uuid(),uuid()); set i=i+1; end while; end character_set_client: utf8mb4 collation_connection: utf8mb4_0900_ai_ci Database Collation: utf8mb4_0900_ai_ci 1 row in set (0.00 sec) ERROR: No query specified
标签:NO,int,create,insertIntoT1Table,call,procedure From: https://www.cnblogs.com/Fred1987/p/17688520.html