mysql create procedure with in parameters ,call procedure
//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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
2022-09-08 decltype delay type
2020-09-08 C# dynamic class inherit from dynamicobject
2019-09-08 dictionary vs Hashtables
2019-09-08 sql
2019-09-08 sql server pivot
2019-09-08 C# regular expression to validate email