这是我在MySQL中的存储过程,我想传递一串多个插入查询
CREATE DEFINER=`root`@`localhost` PROCEDURE `test_stringQry`(IN qry varchar(500))<br>
BEGIN <br>
SET @input = qry; <br>
PREPARE stmt FROM @input; <br>
EXECUTE stmt;<br>
DEALLOCATE PREPARE stmt;<br>
END
当我传递单个查询时,它可以工作,但是当我传递两个或更多查询时,它会给出错误
示例:
call test.test_stringQry("INSERT INTO `test`.`products`(`pro_name`,`pro_price`) VALUES('test',900.00);INSERT INTO `test`.`products`(`pro_name`,`pro_price`) VALUES('test',900.00)")