[egenix-users] Problem calling a stored procedure that returns a resultset

Donnie Woodruff dwoodruff at nngov.com
Wed Jul 21 10:10:17 CEST 2004


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?

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





More information about the egenix-users mailing list