Bruno Desthuilliers wrote:
Tim Chase a écrit :
(if your columns in your CSV happen to match the order of your INSERT
statement, you can just use
execute(sql, tuple(row))
Or more simply:
cursor.execute(sql, row)
that's always annoyed me with the mxODBC drivers I've
used....they require(d?) a tuple in this position, so I developed
this habit. I think the OP hinted they were using postgres
drivers which may be a bit kinder to the user. (and don't get me
started on mxODBC's failure to determine the data-type for
parameters in subqueries, raising exceptions on perfectly valid
queries</rant>)
-tkc
--
http://mail.python.org/mailman/listinfo/python-list