oracle数据库的批量插入
在mysql中批量插入可以直接使用
insert into <表名> (<属性名>,...) values (<值>, ...) , (<值>, ...),...
但是在oracle中不支持这种格式进行批量插入,因此可以使用
insert all
into <表名> (<属性名>,...) values (<值>, ...)
into <表名> (<属性名>,...) values (<值>, ...)
select 1 from dual
注意点 :在oracle中不支持 ` 只支持 "
xml格式
mysql
<insert id="id" parameterType="" >
INSERT INTO <表名> (<属性名>,...)
VALUES
<foreach collection="list" item="iteam" index="index" separator=",">
(#{iteam.属性名}, ... )
</foreach>
</insert>
oracle
<insert id="id" parameterType="" >
INSERT ALL
<foreach collection="list" item="iteam" index="index" >
INTO tableName (<columnName>,...) VALUES (#{iteam.属性名}, ... )
</foreach>
select 1 from dual
</insert>