[Zope-DB] total- variables does not work with MySQL 5.x

Charlie Clark charlie at egenix.com
Thu Aug 30 04:49:56 EDT 2007

Am 30.08.2007, 09:08 Uhr, schrieb Lukas Zapletal  
<lukas.zapletal at gmail.com>:

> Hello,
> I have a problem with "total-*" variables when suming results from
> MySQL 5.x. It does not work with monetary (float) numbers - only with
> integers. When trying to sum floats it cointanins nulls. IMHO the
> reason is in a driver because it probably do not convert numbers in
> national currency format (some countries, e.g. mine, do not use dot as
> separator). The problem is that the driver is outdated and old.

> Is there a fixaround? How could I for example convert the numbers
> explicitely? Or how do I ovverride the behaviour of the code that is
> responsible for the sumarizing?

I'm not familiar with this part of MySQL but if a conversion is required  
then you will probably need to access Python's locale functions in which  
case you can't use ZSQL that easily. I don't reckon the driver is broken  
but you're better off asking the question on the Mysqldb list.

Charlie Clark

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 Zope-DB mailing list