[sqlalchemy] Insert from select?!

2010-11-03 Thread Torsten Landschoff
Hi *, I am wondering if there is a way to generate an insert from select with SQLAlchemy. Consider this code: from sqlalchemy import * engine = create_engine(sqlite:///demo.ldb, echo=True) md = MetaData() users = Table(users, md, Column(id, Integer, primary_key=True), Column(name,

Re: [sqlalchemy] Insert from select?!

2010-11-03 Thread akm
Try this http://www.sqlalchemy.org/docs/05/reference/ext/compiler.html?highlight=compiler#compiling-sub-elements-of-a-custom-expression-construct -- Abdul Kader On Wed, Nov 3, 2010 at 5:09 PM, Torsten Landschoff torsten.landsch...@dynamore.de wrote: Hi *, I am wondering if there is a way to

Re: [sqlalchemy] Insert from select?!

2010-11-03 Thread Torsten Landschoff
On Wed, 2010-11-03 at 17:16 +0530, akm wrote: Try this http://www.sqlalchemy.org/docs/05/reference/ext/compiler.html?highlight=compiler#compiling-sub-elements-of-a-custom-expression-construct Thanks for the pointer, missed that before. So it is in fact doable :) Greetings, Torsten --

[sqlalchemy] Insert from Select Implentation

2010-02-11 Thread Ed Singleton
I've been having a clumsy hack at enabling myself to pass a select statement as a value to an insert statement. IE: sa.insert(mytable).values(myothertable.select()) I've got it working in that most basic case, but I'm struggling when the select statement has bindparams. The insert needs