Re: mx.ODBC error: Invalid Descriptor Index

Alexandre Fayolle <alexandre.fayolle-yG1kfhx/[email protected]>
Newsgroups gmane.comp.python.egenix.user
Organization Logilab
Message-ID <[email protected]>
On Tuesday 13 April 2010 12:03:27 M.-A. Lemburg wrote:
> """
> * For any ODBC or Transact-SQL statement containing a parameter in a HAVING
>  clause, or compared to the result of a SUM function.
> * For any ODBC or Transact-SQL statement depending on a subquery containing
>  parameters.

So this would be why I get a failure for 

SELECT DISTINCT rel_require_permission0.eid_to
FROM require_permission_relation AS rel_require_permission0
WHERE rel_require_permission0.eid_from=? 
AND NOT EXISTS(SELECT 1 FROM require_permission_relation AS 
rel_require_permission1 WHERE rel_require_permission1.eid_from=? 
AND rel_require_permission0.eid_to=rel_require_permission1.eid_to) 

correct? 

> Since SQL Server's ODBC driver supports SQL type binding, this
> is what mxODBC uses per default.
> 
> cursor.executedirect() is a way to work around that default on
> a per-statement basis. It forces mxODBC to use Python type binding
> for that statement.

But if I read the documentation correctly, doing this won't prepare the 
statement, which will worsen the perfs if the statement is reused a lot. 
 

-- 
Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, CubicWeb, Debian :  http://www.logilab.fr/formations
Développement logiciel sur mesure :      http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science


_______________________________________________________________________
eGenix.com User Mailing List                     http://www.egenix.com/
https://www.egenix.com/mailman/listinfo/egenix-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.