我有这样的代码。
SET @empty = 0;
IF (@empty = 0)
THEN
insert into ComputeTasking.Response SET RequestTaskID=@rid,`ResponseJSON`=@JSON;
ELSE
insert into ComputeTasking.Response SET `ResponseJSON`=@JSON;
END IF;
这将返回错误
[ERROR in query 1] 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 'IF (@empty)
THEN
select @empty' at line 1
我知道我可以创建一个过程,但没有权限。还有其他解决方法吗?
谢谢!