why do I get HY000 pyodbc error for my query?
My Sybase query is quite simple for eg.
select adjusted_weight from v_temp_idx_comp where ric_code='0005.HK' and index_ric_code='.HSI'
Query returns result for all columns except for one column -> adjusted_weight. Whenever I include this column in my query I get following error
pyodbc.Error: 'HY000', 'The driver did not supply an error!')
adjusted_weight
column data type defined for this table is numeric which is correct. In fact when I run this query using some other application (which uses other driver) I get results without any error. I have issue only when I query from python using pyodbc.
I am using windows 7 machine, python version 2.6.1 Sybase driver: {Adaptive Server Enterprise}
What is wrong with my column? How can I resolve this issue开发者_如何学JAVA?
resolved this issue. the problem was in the view that i am querying. the precision of one of the columns (which is calculated automatically using some operation) is more than what is supported by sybase standards. Some drivers handle it preopery but some cannot. Sybas's own driver doesn't report error correctly.
Also this error is thrown when using a precompiled version of pyodbc that is not working on arm cpu, like mac M1. Here is the solution: The package is not compiled properly for arm,you can uninstall, in my case pyodbcand install it again. If using brew, it would be like this:
pip uninstall pyodb
and install with compiling it locally:
pip install --no-binary :all: pyodbc
精彩评论