使用PREPARE语句时出现语法错误

时间:2018-05-17 09:25:28

标签: mysql sql

当我尝试运行PREPARE语句时,我在存储过程中收到语法错误

显示以下错误

Syntax error near 'AreaID_var; DEALLOCATE PREPARE stmt1; END' at line 4

BEGIN
PREPARE stmt1 FROM 'SELECT * FROM Area_TBL WHERE Area_ID = ?';
EXECUTE stmt1 USING AreaID_var;
DEALLOCATE PREPARE stmt1;
END

1 个答案:

答案 0 :(得分:0)

按如下方式更改执行行: -

EXECUTE stmt1 USING @AreaID_var;