adodbapi and output parameters in stored procedures

M.-A. Lemburg mal at
Sat Nov 8 15:25:35 CET 2008

On 2008-11-07 17:32, leesquare at wrote:
> Thanks for that excellent pointer!
> I was able to do just what you said with
> But if my procedure has an insert statement in its midst, it doesn't
> work.  The cursor.fetchall() gets an exception.
> Any ideas?

Try this (I haven't checked that it works, but it's a possibility),
assuming your query uses the order SELECT, INSERT, SELECT:

# Fetch results from first SELECT
test_table_result_set = cursor.fetchall()

# Ignore "empty" result set

# Fetch results from second SELECT
(output_variables,) = cursor.fetchone()

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Nov 08 2008)
>>> Python/Zope Consulting and Support ...
>>> mxODBC.Zope.Database.Adapter ...   
>>> mxODBC, mxDateTime, mxTextTools ...

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: 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 Python-list mailing list