我需要的是
将所有查询保存在一个表中
query_id | sql_query
1 | select * from ms_user
2 | select * from ms_privileges
创建程序 这个程序将调用
call my_procedure(query_id)
我尝试了以下代码
DROP PROCEDURE IF EXISTS mp_test;
CREATE PROCEDURE global_procedire(IN id_query int(10));
BEGIN
SET @Query = 'SELECT sql_query from ms_query where query_id = id_query';
SET @Query = CONCAT(@Query);
PREPARE stmt FROM @Query;
EXECUTE stmt;
END