From: Bock, O. B. S. <Oli...@ba...> - 2007-12-06 04:41:22
|
I am connecting to Sybase IQ/12.6.0 using python-sybase and Adaptive Server IQ Network Client 12.6 on Windows XP. Everything works fine for small queries, but a very large query (73000 rows returned) fails like this: Traceback (most recent call last): File "C:\workspace\AlphaExplorer\sql.py", line 19, in ? row =3D curs.fetchone() File "C:\Python24\Lib\site-packages\Sybase.py", line 817, in fetchone return self._fetcher.fetchone() File "C:\Python24\Lib\site-packages\Sybase.py", line 555, in fetchone self._fetch_rowcount() File "C:\Python24\Lib\site-packages\Sybase.py", line 682, in _fetch_rowcount self._raise_error(Error, 'ct_results returned result %s' % str(result)) File "C:\Python24\Lib\site-packages\Sybase.py", line 519, in _raise_error raise exc(text) Sybase.Error: ct_results returned result 4040 This error occurs after I have fetched the last row. (That is, I expect it to return None, indicating that there is nothing left.) Note that I have modified _fetch_rowcount to give information on the result code returned, and it is 4040, which may correspond to CS_ROW_RESULT, although I cannot work out why this should be returned at this time. I can work around the problem by catching the "ct_results" exception and ignoring it, but obviously I would prefer to get to the root cause of the problem. Oliver P.S. python-sybase is MUCH faster than ODBC for this large query: ODBC takes 25 minutes and python-sybase takes 18 seconds! (The server is in another country so I guess there is a very high network latency.)=20 =20 --=20 =20 This message and any attachments are confidential, proprietary, and may = be privileged. If this message was misdirected, Barclays Global = Investors (BGI) does not waive any confidentiality or privilege. If you = are not the intended recipient, please notify us immediately and destroy = the message without disclosing its contents to anyone. Any = distribution, use or copying of this e-mail or the information it = contains by other than an intended recipient is unauthorized. The views = and opinions expressed in this e-mail message are the author's own and = may not reflect the views and opinions of BGI, unless the author is = authorized by BGI to express such views or opinions on its behalf. All = email sent to or from this address is subject to electronic storage and = review by BGI. Although BGI operates anti-virus programs, it does not = accept responsibility for any damage whatsoever caused by viruses being = passed. |