我需要从动态查询插入表中。我尝试使用Prepare and Execute语句,但是它不起作用。请帮助我做错的地方。
SET v_SQL = 'Select * from Patient';
DROP TEMPORARY TABLE IF EXISTS AlcoholTable;
CREATE TEMPORARY TABLE AlcoholTable ( PatientId int ,MRNNo varchar(500),Gender varchar(500))
Insert into AlcoholTable
SET stmt_str = v_SQL;
PREPARE stmt FROM stmt_str;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;