下面给出的代码是存储过程的一部分(mysql 5.5.20):
prepare stmnt1 from concat('insert into ' , tableName , '(employee_id , administrator_id) values(? , ?) ' ) ;
set @a = 19 ;
set @b = 11;
execute stmnt1 using @a , @b ;
tableName
是局部变量
当我创建程序时,我收到此错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'concat('insert into ' ,
tableName , '(employee_id , administrator_id) values(? ' at line 23
好像这种说法在mysql中是不可能的。
请帮忙。谢谢。