我正在尝试在mySQL中编写一个事务,但无论我在标记之间放置什么都有错误。
start transaction;
set @email = "FOO";
PRINT @email;
commit;
此块总是会产生错误:
SQL Error [1064] [42000]: 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 'set @email_name = "FOO";
PRINT @email_name;
commit' at line 2
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'set @email_name = "FOO";
PRINT @email_name;
commit' at line 2
无论在事务中放置什么代码,都会发生此行为,如果有相关内容,则会出现此问题。
答案 0 :(得分:0)
没有PRINT,请改用SELECT。