Answer the question
In order to leave comments, you need to log in
How to execute insert from list of RowProxy in SQLAlchemy?
I do a raw select into a remote table (maybe fields are sometimes added or deleted in a table), and then I want to make an insert into my table
data = remote_session.execute("SELECT key1, key2 FROM table").fetchall()
insert_stmt = insert(Table).values(data)
local_session.execute(insert_stmt)
Could not locate column in row for column 'translate'
data = remote_session.execute("SELECT key1, key2 FROM table").fetchall()
for key, value in enumerate(data):
data[key] = dict(value)
insert_stmt = insert(Table).values(data)
local_session.execute(insert_stmt)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question