SET @pddl = concat('select * from user', @var)
PREPARE stmt FROM @pddl/*定义预处理语句*/
EXECUTE stmt/*执行预处理语句*/
DEALLOCATE PREPARE stmt/*释放预处理语句*/
使用预处理语句,如:SET
@pddl
=
concat('select
*
from
user',
@var)
PREPARE
stmt
FROM
@pddl/*定义预处理语句*/
EXECUTE
stmt/*执行预处理语句*/
DEALLOCATE
PREPARE
stmt/*释放预处理语句*/
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)