首頁 >
資料庫 >
mysql教程 >
MySQL 存储过程中执行动态SQL语句的方法_MySQL
MySQL 存储过程中执行动态SQL语句的方法_MySQL
WBOY
發布: 2016-06-01 13:05:16
原創
1018 人瀏覽過
drop PROCEDURE if exists my_procedure;
create PROCEDURE my_procedure()
BEGIN
declare my_sqll varchar(500);
set my_sqll='select * from aa_list';
set @ms=my_sqll;
PREPARE s1 from @ms;
EXECUTE s1;
deallocate prepare s1;
end;