In SQLAlchemy, how do I populate or update a table from a SELECT statement?
In SQLAlchemy, how do I populate or update a table from a SELECT statement?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SQLalchemy doesn’t build this construct for you. You can use the query from text.
EDIT:
More than one year later, but now on sqlalchemy 0.6+ you can create it:
Produces:
Another EDIT:
Now, 4 years later, the syntax is incorporated in SQLAlchemy 0.9, and backported to 0.8.3; You can create any
select()and then use the newfrom_select()method ofInsertobjects:More information in the docs.