- 循环插入数据
delimiter $$
drop procedure if exists test;
create procedure test (num int)
begin
declare i int default 1;
while i<=num do
insert into test values (i,concat(‘test‘,i));
set i=i+1;
end while;
end $$
#concat 信息连接符 - 测试插入数据
delimiter $$
create procedure zy (v1 int,v2 varchar(20),v3 varchar(20))
begin
insert into zy values (v1,v2,v3);
end $$ - 查看数据库的存储过程
show procedure status where db=‘‘/name=‘‘;
- 调用存储
call test(xx);
- 查询创建存储的脚本
show create procedure name;
时间: 2024-10-24 21:22:16