Hello, I'm having trouble doing insertmany correctly. I read the docs and came up with this code:
s = Session() ins = data_tbl.insert() records = [] for rec in s.execute(sql).fetchall(): records.append(rec) ins.execute(records) It gives an error: File '/var/www/site-baseline/doupy/doupy/controllers/salarydb.py', line 170 in update_clean ins.execute(records) File '/var/www/site-baseline/py/lib/python2.5/site-packages/ SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/sql/expression.py', line 1129 in execute return e.execute_clauseelement(self, multiparams, params) File '/var/www/site-baseline/py/lib/python2.5/site-packages/ SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/engine/base.py', line 1181 in execute_clauseelement return connection.execute_clauseelement(elem, multiparams, params) File '/var/www/site-baseline/py/lib/python2.5/site-packages/ SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/engine/base.py', line 848 in execute_clauseelement keys = params[0].keys() AttributeError: 'list' object has no attribute 'keys' Huh? Max. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---