[egenix-users] Problem calling a stored procedure that returns
a resultset
M.-A. Lemburg
mal at egenix.com
Wed Jul 21 16:28:51 CEST 2004
Donnie Woodruff wrote:
> I am trying to call a stored procedure that returns a single result set
> using the following code on Python 2.3 and mxODBC installed using
> distutils on Debian:
> from mx.ODBC.unixODBC import DriverConnect as DB2
> conn = DB2('DSN=DB2D;UID=xxxxxx;PWD=xxxxxx')
> cur = conn.cursor()
> cur.execute("{call FINA.PRQSSP01}")
> #cur.execute("select * from sysibm.sysdummy1")
> print cur.fetchall()
> cur.close()
> conn.close()
>
> I receive the following message:
> Traceback (most recent call last):
> File "callstored.py", line 5, in ?
> cur.execute("{call FINA.PRQSSP01}")
> mxODBC.InterfaceError: ('0100C', 466, '[unixODBC][StarSQL][StarSQL CLI
> Driver][DB2]CALL PROCEDURE RETURNED ONE OR MORE QUERY RESULT SETS.', 4612)
>
> I know the unixODBC and StarSQL drivers are working when calling a
> stored procedure with a resultset because when I call this same stored
> procedure via isql it works just fine.
>
> Does anyone have any suggestions?
You need to recompile mxODBC using the DONT_REPORT_WARNINGS
compile time switch. Edit mxCOMMERCIAL.py to add this macro definition:
define_macros=[('unixODBC', None),
('DONT_REPORT_WARNINGS', None)],
> One other note -- if we run the same code on Windows changing the import
> statement to:
> from mx.ODBC.Windows import DriverConnect as DB2
> the program works just fine.
>
> Thanks for the help!
> Donnie
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Jul 21 2004)
>>> 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,FreeBSD for free ! ::::
More information about the egenix-users
mailing list