mkleehammer / pyodbc

Python ODBC bridge
https://github.com/mkleehammer/pyodbc/wiki
MIT No Attribution
2.92k stars 563 forks source link

output_converter not called #958

Closed ChristophGaukel closed 2 years ago

ChristophGaukel commented 2 years ago

We use pyodbc in combination with IBM DATA SERVER RUNTIME CLIENT.

pyodbc.version says '4.0.0-unsupported'.

IBM sends ODBC SQL type == 93 for not localized timestamps and ODBC type == 95 for localized timestamps. pyodbc seems not to have an output converter for type 95. When I add it, the error type changes from ProgrammingError to Error, but it is not called and the error text is"Invalid conversion".

In case of NULL values in the localized timestamp column, setting an output converter helps to avoid ProgrammingError and executes successfully, but also does not call the output converter.

gordthompson commented 2 years ago

SQL types 93 and 95 are standard types defined in sql.h

https://github.com/microsoft/ODBC-Specification/blob/b7ef71fba508ed010cd979428efae3091b732d75/Windows/inc/sql.h#L225-L229

so I'm a bit surprised that you're having issues with 95. Without the output converter function are you getting an error like this?

pyodbc.ProgrammingError: ('ODBC SQL type 95 is not yet supported. column-index=0 type=95', 'HY106')

Also, I'm a bit confused because you say that when you try to add an output converter function for 95 "the error type changes" but you also say that "it is not called".

Can you show us some code and the actual error message(s) it produces?

gordthompson commented 2 years ago

Closing as inactive.