[egenix-users] mxODBC Cursor Unicode issue with method
executedirect().
Cliff Xuan
Cliff.Xuan at artsalliancemedia.com
Tue Aug 7 16:37:51 CEST 2007
Hi Charlie,
Thanks a lot for your email. It makes a lot of sense to me, however,
another problem occurs here.
In the first email I had this stored procedure spFindUser.
selectsql = "{call spFindUser(?)}"
Now I expand that bit by inserting the sql query of it in the python
source code, then it looks like this:
selectsql2= """
select id
from vwUserWide
where
caller_language_id in ('none','en') and (
username like ('%' + ? + '%')
or (coalesce(firstname+' ','')+coalesce(lastname,''))
like ('%' + ? + '%')
or email like ('%' + ? + '%')
or venue_longname like ('%' + ? + '%')
or venue_shortname like ('%' + ? + '%') )
"""
cur.execute(selectsql2, [(u'\xe5', u'\xe5', u'\xe5',
u'\xe5',u'\xe5',)])
cur.executedirect(selectsql2, [(u'\xe5', u'\xe5', u'\xe5',
u'\xe5',u'\xe5',)])
This time executedirect() returns nothing as before. Execute() doesn't
work any more, the error message reads "Unable to derive parameter
information when parameter marker is a function argument".
Hope you can enlighten me again.
Many Thanks
Cliff
Cliff Xuan
-----Original Message-----
From: Charlie Clark [mailto:charlie at egenix.com]
Sent: 07 August 2007 14:55
To: Cliff Xuan; egenix-users at egenix.com
Subject: Re: [egenix-users] mxODBC Cursor Unicode issue with method
executedirect().
Am 07.08.2007, 15:26 Uhr, schrieb Cliff Xuan
<Cliff.Xuan at artsalliancemedia.com>:
>
> One questions on this:
> What does 'prepare step' mean?
Most database engines allow sql statements to be "prepared", ie. parsed,
and the parameters passed in separately and handled by the database ODBC
driver and not Python. For repetitive queries with different parameters
this can mean a significant difference in performance. As the
documentation says there may be cases where the database ODBC driver
doesn't support this or isn't very efficient and executedirect() may,
therefore, be preferable. I don't think you should need to use
executedirect() with MS SQL.
Charlie
--
Charlie Clark
eGenix.com
Professional Python Services directly from the Source
>>> 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