我使用mybatis-3.2.4和PostgreSQL。我尝试执行匿名过程但失败了。以下是我的演示sql:
<delete id = "deleteSomeTable" statementType = "CALLABLE">
{call
declare
begin
delete from test1;
delete from test2;
end
}
</delete>
但是当我执行这个sql时,会发生错误并且错误消息是:
Cause: org.postgresql.util.PSQLExeception:
incorrect function or procedure escape program at 51
第51个字符是第一个分号。
如何解决此问题?或者任何人都向我展示了一个通过mybatis执行匿名程序的演示?
答案 0 :(得分:0)
我认为你只需要编写像这样的声明语句
declare
begin
delete from test1;
delete from test2;
end