|
mapper.xml 中写法:
<!-- 彻底删除机构,同时删除其对应的所有相关的数据 -->
<delete id="deleteDepart">
BEGIN
DELETE FROM sys_user_menu t WHERE t.user_id in(select id from sys_user where depart_id=#{departId});
DELETE FROM sys_depart_role t WHERE t.depart_id=#{departId};
DELETE FROM sys_user t WHERE t.depart_id=#{departId};
DELETE FROM sys_depart t WHERE t.id=#{departId};
END;
</delete>
报错信息:
==> Preparing: BEGIN DELETE FROM sys_user_menu t WHERE t.user_id IN (SELECT id FROM sys_user WHERE depart_id = ?); DELETE FROM sys_depart_role t WHERE t.depart_id = ?; DELETE FROM sys_user t WHERE t.depart_id = ?; DELETE FROM sys_depart t WHERE t.id = ?; END
==> Parameters: ff8080816e44382f016e49ab522e031a(String), ff8080816e44382f016e49ab522e031a(String), ff8080816e44382f016e49ab522e031a(String), ff8080816e44382f016e49ab522e031a(String)
2021-11-19 07:55:04.005 [http-nio-8000-exec-1] [1;31mERROR[0;39m [36mdruid.sql.Statement:149[0;39m - {conn-10004, pstmt-20012} execute error. BEGIN
DELETE FROM sys_user_menu t WHERE t.user_id IN (SELECT id FROM sys_user WHERE depart_id = ?);
DELETE FROM sys_depart_role t WHERE t.depart_id = ?;
DELETE FROM sys_user t WHERE t.depart_id = ?;
DELETE FROM sys_depart t WHERE t.id = ?;
END
java.sql.SQLException: ORA-06550: 第 6 行, 第 3 列:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
; <an identifier> <a double-quoted delimited-identifier>
The symbol ";" was substituted for "end-of-file" to continue.
看错误信息是最后end后面没有;结束,但源码上明明有中,请大家分析一下。
|
|