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

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

WBOY
Release: 2016-06-06 09:37:40
Original
1535 people have browsed it

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>
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template