> that is absolutely the wrong way to execute an insert statement. > Query is used for selecting rows and returning object instances. > use engine.execute() or session.execute() for insert statements.
ok, I just see at documentation that execute method was deprecated, but I will use execute to do this, I discovered a method to get the bind connection from turbogears api, and now I can create my session by this method ---code--- engine = get_engine() Session = sessionmaker(bind=engine, transactional=True) sess = Session() ---code--- and perform inserts using something like sess.execute(u"insert code") > use semicolons in the file and then split on the semicolon instead of > the newline. it seems to be a way, but looking sa documentation I found statements using the text(), if I can use it to create multiline statements like create procedures, functions, etc, I will use it to avoid sql files and centralize all additional metadata and inserts into python scripts, it is always easier to me maintain python files versioned. thank you again and happy new year! att, -- Alexandre da Silva Analista de Sistemas - Bacharel em Sistemas de Informação (2003-2007) gedit-todo http://alexandredasilva.wordpress.com/gedit-todo-list-plugin/ MicroDB http://www.assembla.com/space/microdb Open Sales Force System http://www.assembla.com/space/osfs opencomanche ([stopped] mail-me to get the latest source code) http://sourceforge.net/projects/opencomanche/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
