[egenix-users] Impossible to correct execute stored procedure using cursors

M.-A. Lemburg mal at egenix.com
Wed Nov 5 15:12:41 CET 2008

On 2008-11-05 14:52, Sirio Capizzi wrote:
> M.-A. Lemburg ha scritto:
>> On 2008-11-05 12:45, Sirio Capizzi wrote:
>>   Have you tried this in the SQL Server Management GUI ?
>> Since the stored procedure runs entirely on the server
>> side, I don't think that mxODBC or the ODBC driver
>> can cause this behavior.
> Yes, I have tried it on the server side and it works correctly. Moreover
> on the same client was installed mxODBC 2.0.6 for python 2.3 and it
> worked fine too. After upgrading to python 2.5 and mxODBC 3.0.2 we got
> this problem but only on stored procedures using cursors (the others
> work fine). So I think that this behavior is caused by the new mxODBC
> library.

mxODBC 3.0 tries to use the ODBC 3.x API where possible,
so that may explain why you are seeing different behavior
compared to mxODBC 2.0.

The SQL Server 2000 ODBC driver is rather old, so it's possible
that it doesn't support the ODBC 3.x API all that well.

However, our tests pass just fine for that driver as well, but
AFAIK we don't use cursors in the tested stored procedures, so
that's something to add to the test suite.

>> The segfault is likely caused by the above option setting:
>> SQL.CURSOR_TYPE is a *cursor* option, not a connection
>> option, so you're adjusting some unknown option on the
>> connection to some unknown value.
>> BTW: Please don't change the SQL.CURSOR_TYPE value - mxODBC
>> uses static cursors for efficiency and also to enable
>> scrolling in result sets.
> You are right. However the connectionoption doesn't influence the
> behavior of the callproc function. In fact without this line python
> still crashes.

Could you send us an ODBC trace that shows the crash (ie. stops
after the crash) ?

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Nov 05 2008)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the egenix-users mailing list