动态执行sql语句,把存储过程灵活的运用起来
1 delimiter $$ 2 drop procedure if exists proc $$ 3 create procedure proc(in StrSql varchar(128) , in nid int ) 4 begin 5 set @id = nid; 6 set @ssql = StrSql; 7 create prod from @ssql; 8 execute prod using @id; 9 deallocate prepare prod; 10 end $$ 11 delimiter ;
原文地址:https://www.cnblogs.com/dontgiveup/p/9384384.html
时间: 2024-11-05 20:35:48