Home >Database >Mysql Tutorial >mysql存储过程中动态表名的使用

mysql存储过程中动态表名的使用

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:37:401543browse

mysql存储过程

BEGIN

<code>if tablename is not null thendeclare v_sql varchar(500);set v_sql = concat('select  WXPayBillID,WXPayMoney FROM ',tablename);select v_sql;set @v_sql=v_sql;///这里写的有问题?prepare stmt from @v_sql;EXECUTE stmt;deallocate prepare stmt;end if;</code>

END
为什么老是提示illegal symbol:'@';我这个存储过程到底哪儿写错了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn