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

QueryBuilder insert for Oracle failed #2434

Closed
yuluyi opened this issue Jun 29, 2018 · 3 comments · Fixed by #6927
Closed

QueryBuilder insert for Oracle failed #2434

yuluyi opened this issue Jun 29, 2018 · 3 comments · Fixed by #6927

Comments

@yuluyi
Copy link

yuluyi commented Jun 29, 2018

Issue type:

[ ] question
[X] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[X] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native

TypeORM version:

[X] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

await queryRunner.manager.createQueryBuilder()
          .insert()
          .into(Person)
          .values(people)
          .execute()

// { Error: ORA-00933: SQL command not properly ended errorNum: 933, offset: 140 }

Oracle seems doesn't support syntax like INSERT INTO xxx VALUES (value1, ...), (value2, ...)

@pleerock
Copy link
Member

pleerock commented Jul 2, 2018

ah batch insertion is not supported by oracle. Please use a regular for loop over your values and insert data within multiple queries

@Kononnable
Copy link
Contributor

I think we could make it work by changing generated queries - https://stackoverflow.com/questions/39576/best-way-to-do-multi-row-insert-in-oracle

@imnotjames imnotjames added the bug label Oct 6, 2020
wfpena added a commit to wfpena/typeorm that referenced this issue Oct 17, 2020
change generated insert query to allow inserting an array of objects to oracle

fixes: typeorm#2434
@wfpena
Copy link
Contributor

wfpena commented Oct 17, 2020

I created a PR to solve this issue #6927

wfpena added a commit to wfpena/typeorm that referenced this issue Oct 17, 2020
change generated insert query to allow inserting an array of objects to oracle

fixes: typeorm#2434
wfpena added a commit to wfpena/typeorm that referenced this issue Oct 19, 2020
change generated insert query to allow inserting an array of objects to oracle

fixes: typeorm#2434
wfpena added a commit to wfpena/typeorm that referenced this issue Oct 19, 2020
change generated insert query to allow inserting an array of objects to oracle

fixes: typeorm#2434
pleerock pushed a commit that referenced this issue Oct 26, 2020
change generated insert query to allow inserting an array of objects to oracle

fixes: #2434
dolsup pushed a commit to dolsup/typeorm that referenced this issue Nov 3, 2020
change generated insert query to allow inserting an array of objects to oracle

fixes: typeorm#2434
zaro pushed a commit to zaro/typeorm that referenced this issue Jan 12, 2021
change generated insert query to allow inserting an array of objects to oracle

fixes: typeorm#2434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants