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

M.-A. Lemburg mal at egenix.com
Mon Jul 26 11:56:39 CEST 2004


Donnie Woodruff wrote:
> I added the following:
>                 define_macros=[('unixODBC', None),
>                                 ('DONT_REPORT_WARNINGS', None)],
> and recompiled using "python setup.py install" but am still receiving 
> the same error.  Am I supposed to do something else?
> Is the message a "warning message" or an "error message"?
> 
> mxODBC.InterfaceError: ('0100C', 466, '[unixODBC][StarSQL][StarSQL CLI 
> Driver][DB2]CALL PROCEDURE RETURNED ONE OR MORE QUERY RESULT SETS.', 4612)

The error message that you are seeing is a non-standard ODBC warning.

All error messages starting with '01' are normally considered
warnings; even though some of these warnings are mapped to errors
in mxODBC because they inform about critical problems such as data
truncation.

If mxODBC finds a non-standard error message, it maps it
to InterfaceError which is what you are seeing.

You may have to add the error code and a mapping to
Warning to the mxODBC.c error code table to silence the
warning.

We could help you with this on a support ticket basis.

> Thanks for the quick response.
> Donnie
> 
> 
> 
> M.-A. Lemburg wrote:
> 
>> 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
>>
>>
>>
> 
> 
> _______________________________________________________________________
> eGenix.com User Mailing List                     http://www.egenix.com/
> http://lists.egenix.com/mailman/listinfo/egenix-users

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 26 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