为什么我会收到此错误?
CREATE DEFINER=`root`@`localhost` PROCEDURE `selectrecords`(tablename varchar(50))
begin
set @table_name=tablename;
set @sql_text=concat('Select * from @table_name');
prepare statement from @sql_text;
execute statement;
deallocate prepare statement;
end
错误:
....to use near '@table_name' at line 1
我的代码是正确的,但我不明白为什么....