[sqlalchemy] Re: How can i use insert/update with transactions

2009-11-02 Thread 杨晓瑜
O~~ I see Thank u~ Mike [?] 2009/10/29 Mike Conley > Looks like you are trying to mix ORM and SQL expression constructs. > Also, Insert() objects should be constructed via the insert() function. > > Try this > > conn = session.connection() # get handle to the session's connection > t = conn.b

[sqlalchemy] Re: How can i use insert/update with transactions

2009-10-29 Thread Mike Conley
Looks like you are trying to mix ORM and SQL expression constructs. Also, Insert() objects should be constructed via the insert() function. Try this conn = session.connection() # get handle to the session's connection t = conn.begin() res = conn.execute(insert(t_table).values(id=None,pv=6)) pri