I'm getting parameter conversion errors when updating from version 3.1.1 to 4.0.17 in some environments.....
[HY000] [IBM][System i Access ODBC Driver][DB2
for i5/OS]SQL0302 - Conversion error on variable or parameter *N. (-302)
(SQLExecDirectW)
This appears to be from using a text parameter on a numeric field.
Some example code that would cause this would look like this:
sql_stmt = "SELECT * from ORDERS where order_id = ?"
cursor.execute(sqlstmt, "1") # Potential failure
cursor.execute(sqlstmt, 1)
This is a web application that I have been using pyodbc in for several years (thanks for a great library). I would just convert parameters all over my application if the new version requires better typing but I thought I would ask the question of if this is expected before I look at next steps to address. Here are the environments:
Works - Windows 7 (64bit), Python 3.5.3 (32bit), Pyodbc 3.1.1
Works - Windows 7 (64bit), Python 3.5.3 (32bit), Pyodbc 4.0.17
Works - Linux Debian 9 (64bit), Python 3.5.3 (64bit), Pyodbc 3.1.1
Fails - Linux Debian 9 (64bit), Python 3.5.3 (64bit), Pyodbc 4.0.17
Any thoughts?
Thanks
Cory Lutton