"Invalid Parameter Type" when following "pyodbc objects/Row" section #1298
-
Environment
IssueWhen executing this insert command: for index, row in tarefas.cronograma_df.iterrows():
cursor.execute("INSERT INTO stage.SomeTableAPI (id,_id,Posicao,Item,Descricao,Porcentagem) values(?,?,?,?,?,?)"
,row.id ,row._id ,row.posicao,row.item ,row.descricao ,row.porcentagem) I received the following error message: Even after reading the documentation and following the solution described therein, the problem persisted. I managed to get around the problem and I leave a suggestion below on how I resolved it. Method present in the documentation:
What solved it:
But I'm wondering if there's an official way recommended by the library. Maybe adding a warning in the documentation would be good, in case you access columns with the same name as a reserved attribute. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For the statement for index, row in tarefas.cronograma_df.iterrows():
|
Beta Was this translation helpful? Give feedback.
For the statement
row
is a pandasSeries
object, not a pyodbcRow
object, so this is more of a question/comment about pandas rather than pyodbc.