adodbapi and output parameters in stored procedures
M.-A. Lemburg
mal at egenix.com
Sat Nov 8 09:25:35 EST 2008
On 2008-11-07 17:32, leesquare at yahoo.com 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()
cursor.nextset()
# Ignore "empty" result set
cursor.nextset()
# Fetch results from second SELECT
(output_variables,) = cursor.fetchone()
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Nov 08 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 Python-list
mailing list