这是我的简单sp执行两个查询,但MySQL不能允许它, 是不是两种方式在MySQL中动态执行多个查询
CREATE DEFINER=`test`@`%` PROCEDURE `usp_test.test`()
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
Rollback;
resignal;
END;
start transaction;
set @dynamicquery='
select Now();
select NOW();
';
PREPARE stmt1 FROM @dynamicquery;
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
commit;
END