why do I get HY000 pyodbc error for my query?

Question:

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?

Asked By: Alok

||

Answers:

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.

Answered By: Alok

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
Answered By: zhrist
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.