67,511
社区成员
发帖
与我相关
我的任务
分享
<insert id="insertBatch" >
insert into student ( <include refid="Base_Column_List" /> )
values
<foreach collection="list" item="item" index="index" separator=",">
(null,#{item.name},#{item.sex},#{item.address},#{item.telephone},#{item.tId})
</foreach>
</insert>
会报错,ORA-00933: SQL 命令未正确结束,ORACLE应该不支持这种写法吧,然后改成这样
<insert id="insertBatch" >
<foreach collection="list" item="item" index="index" separator=",">
insert into student ( <include refid="Base_Column_List" /> )
values
(null,#{item.name},#{item.sex},#{item.address},#{item.telephone},#{item.tId})
</foreach>
</insert>
还是报错,谁遇到过这种情况,帮忙看下,多谢了,另外问下mybaits这种批量插入的方式如果用SPRING管理事物,中途插入异常会回滚吗?