Skip to content

Commit 716862a

Browse files
committed
EHN: allow for to_sql multi method with oracle backend
1 parent 2baaaa6 commit 716862a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/source/whatsnew/v2.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enhancement2
2828

2929
Other enhancements
3030
^^^^^^^^^^^^^^^^^^
31-
-
31+
- :meth:`to_sql` with method parameter set to ``multi`` works with Oracle on the backend
3232
-
3333

3434
.. ---------------------------------------------------------------------------

pandas/io/sql.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ def _execute_insert_multi(self, conn, keys: list[str], data_iter) -> int:
960960
from sqlalchemy import insert
961961

962962
data = [dict(zip(keys, row)) for row in data_iter]
963-
stmt = insert(self.table).values(data)
964-
result = conn.execute(stmt)
963+
stmt = insert(self.table)
964+
result = conn.execute(stmt, data)
965965
return result.rowcount
966966

967967
def insert_data(self) -> tuple[list[str], list[np.ndarray]]:

0 commit comments

Comments
 (0)