[egenix-users] cursor.executedirect configurable?

M.-A. Lemburg mal at egenix.com
Thu Sep 11 13:08:37 CEST 2008

On 2008-09-10 21:49, Brad Allen wrote:
> M.-A. Lemburg wrote:
>>> Here is the error:
>>> mx.ODBC.Error.InterfaceError: ('07009', 0, '[Microsoft][ODBC SQL Server
>>> Driver]Invalid Descriptor Index', 6793)
>> Could also post the query and parameters that caused this problem ?
>> The error is related to a parameter you have in the query which
>> the client apparently does not detect correctly.
> The query is a bit ugly; it is generated by Storm and the table aliases
> are numeric, not designed to be human readable. Also, I copied it
> straight from the DOS prompt. If you need to really read and fully
> understand the query, I can send an alternate human readable version.
> The parameters are all plain ascii strings. We have configured mxODBC to
> See the pdb transcript below, showing first the statement, and after
> that the parameters.
> (Pdb) statement
> ... long query better not shown in public ;-) ...
> (Pdb) params
> [<storm.variables.RawStrVariable object at 0x0161C350>,
> <storm.variables.RawStrV
> ariable object at 0x0161C3B0>, <storm.variables.RawStrVariable object at
> 0x0161C
> 490>, <storm.variables.RawStrVariable object at 0x0161C4F0>,
> <storm.variables.Ra
> wStrVariable object at 0x0161C590>, <storm.variables.RawStrVariable
> object at 0x
> 0161C5F0>, <storm.variables.RawStrVariable object at 0x0161C690>,
> <storm.variabl
> es.RawStrVariable object at 0x0161C6F0>]
> (Pdb) for param in params: print param.get()
> Y
> X
> X
> Y
> X
> Y
> X
> Y

You have 8 '?' markers in your query, so that looks fine. However,
the query is rather complicated with respect to all the joins, so
it's possible that the ODBC driver doesn't parse the query correctly
and perhaps misses out on some of the parameter markers.

It may also get confused by the "_3" aliases. Why the quotes and why
double-quotes instead of square brackets ?. What setting do you

Some more general questions:

Are you using the most recent SQL Server Native client on the
Windows machine ?

How are you converting the params before using them on
cursor.execute() ?

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Sep 11 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 egenix-users mailing list