0

I recently started using a Windows 7 box. I am trying to query a Sybase database using 32-bit ASE drivers (Adaptive Server Enterprise). The Sybase client installed on the machine is v15.5.

The issue is that when I query for small data I get correct result but if the result expected is more than 40 rows I am getting an error.

  >>> x = smd.Query("select ric_code as ric, weight, adjusted_weight as adjweight,
  currency as currency, close_price as last from v_temp_idx_comp where index_ric_
 code='.HSI'")
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "s:\quant\python\v1.0\smd.py", line 15, in Query
     result = x.fetchall()
 pyodbc.Error: ('HY000', 'The driver did not supply an error!')

I am not sure how to resolve this error. What steps can I take to debug this further? Can I use some command line tools to investigate further? how about isql? Will they use same underlying drivers?

FYI, there is no issues with the query. The query works very well on my previous machine which used Merant driver.

Any suggestions are welcome.

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
Alok
  • 3,160
  • 3
  • 28
  • 47
  • error is coming in cursor's `fetchall()` function call. – Alok May 08 '12 at 07:15
  • i just found out that there is an issue with one of the columns in the result set which is corrupting the output. i have to investigate further how to avoid this. if i drop that column then i am getting the data properly. – Alok May 08 '12 at 09:51

1 Answers1

1

I just came across this post of yours because I was running into the exact same issue. (Windows 7 and Sybase ASE 15.5 [only python 2.7.2 in my case].)

I think I just figured out my problem: one of the columns in the table I was querying was defined as having "bigint" data type. Since this is a new table for me, I dropped the table and recreated it using only "int" as the data type, and now it works just fine. I was lucky because it turned out that I really don't need the extra capacity of the "bigint" type -- "int" is enough for what I'm doing.

Kijewski
  • 25,517
  • 12
  • 101
  • 143
Tom Trop
  • 54
  • 1
  • 3
  • we also found the issue. one of the views that was generated dynamically had a column with precision that is not handled by the driver. after changing the view defnition and forcing the column to have proper precision value, we were able to solve the problem. sadly driver is not supplying error correctly. – Alok Jul 09 '12 at 03:22