Home > Database > Mysql Tutorial > body text

mybatis中配置批量insert mysql,oracle_MySQL

WBOY
Release: 2016-06-01 13:34:13
Original
995 people have browsed it

bitsCN.com

mybatis中配置批量insert mysql,oracle

 

有时候需要传入一个list(或集合),通过mybatis进行批量Insert的,语法如下:

 

Mysql:

 

1

insert into TableName(F_ID,F_value) values

2

3

    (#{lt.id},#{lt.value})

4

 

Oracle:

 

1

insert into TableName(F_ID,F_value)

2

3

    select #{lt.id},#{lt.value} from dual

4

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template