Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support insert multiple rows and write-back id #547

Merged
merged 1 commit into from Jan 16, 2016
Merged

Support insert multiple rows and write-back id #547

merged 1 commit into from Jan 16, 2016

Conversation

abel533
Copy link
Contributor

@abel533 abel533 commented Jan 3, 2016

Support insert multiple rows and write-back id.

Multirow inserts

A SQL feature (since SQL-92) is the use of row value constructors to insert multiple rows at a time in a single SQL statement:

INSERT INTO tablename (column-a, [column-b, ...])
VALUES ('value-1a', ['value-1b', ...]),
('value-2a', ['value-2b', ...]),
...
This feature is supported by DB2, SQL Server (since version 10.0 - i.e. 2008), PostgreSQL (since version 8.2), MySQL, sqlite (since version 3.7.11) and H2.

More about insert see here:

http://en.wikipedia.org/wiki/Insert_(SQL)
More details of this pull request see here: #350

@abel533
Copy link
Contributor Author

abel533 commented Jan 16, 2016

@emacarron Do you have some time to look at this pr?

@emacarron emacarron merged commit f09e268 into mybatis:master Jan 16, 2016
@emacarron
Copy link
Member

Hi @abel533 I have just reviewed the contribution, converted it to postresql and meged it into master.

Thank you very much for you work!

@harawata
Copy link
Member

Thanks guys!

By the way, is anyone working on the documentation of this feature?
If not, I will add a brief note and an example.

@emacarron emacarron added the enhancement Improve a feature or add a new feature label Feb 10, 2016
@emacarron emacarron added this to the 3.3.1 milestone Feb 10, 2016
@emacarron emacarron self-assigned this Feb 10, 2016
emacarron added a commit that referenced this pull request Feb 10, 2016
harawata added a commit to harawata/mybatis-3 that referenced this pull request Oct 12, 2017
…ole parameter, its name does not matter anymore.
harawata added a commit to harawata/mybatis-3 that referenced this pull request Oct 12, 2017
…ole parameter, its name does not matter anymore.
@bambooj
Copy link

bambooj commented Jan 11, 2019

Support for Oracle?

@h3adache
Copy link
Member

h3adache commented Jan 11, 2019

@bambooj Oracle's multi row insert is INSERT ALL

@mybatis mybatis locked as resolved and limited conversation to collaborators Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Improve a feature or add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants