[egenix-users] mxODBC Zope DA and None vs. ""

M.-A. Lemburg mal at lemburg.com
Wed Jun 18 17:07:34 CEST 2003


F.Baart at sfk.nl wrote:
> Hello,
> 
> I recently switched from ZODBC DA to mxODBC Zope DA . Although the
> transition did go quite smoothly I am facing some incompatibilities which I
> am not sure how to deal with:
> 
> 1. mxODBC returns empty strings as None, where ZODBC returns empty strings.
> This results in "None"'s popping up al over the place including in my
> database.

Some databases treat emtpy strings as NULL. A prominent example is
Oracle. mxODBC maps NULL values it gets from the database ODBC driver
to Python's None and that's what you are probably seeing. If the database
passes back an empty string, mxODBC will also give you an empty
string, so in your case, the ODBC driver is generating the NULL
value.

> For example: Using inputs in a <dtml-in sql> results someting like:
> <input type="text" value="None"/>
> After using the text from the input, all empty chars in de database are
> changed to "None", which is somewhat annoying.

ZODBC fetches everything as string which is why you see the
emtpy string on ZODBC DA output.

It looks as if in order to reach full compatibilty, we'll have
to add another connection option to the DA.

> 2. mxODBC returns either returns DECIMAL(n.0) as a float or FLOAT as an
> integer depending on the setting of "leave scale 0 floats untouched".

I'm not sure I understand that question. The ZODBC DA converts
all scale 0 numbers to integers and that's what what the mxODBC Zope
DA does too if you leave that setting disabled.

> Any help would be appreciated.
> 
> Thanks,
> 
> Fedor
> fedor at sfk dot nl
> SFK
> 
> I am using ISeries DB2  on OS/400 5r1 as a database with client-access
> express ODBC drivers and zope 2.6.1 (mxODBC DA 1.0.4) on win2k.
> 
> 
> 
> _______________________________________________________________________
> eGenix.com User Mailing List                     http://www.egenix.com/
> http://lists.egenix.com/mailman/listinfo/egenix-users

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Jun 18 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
EuroPython 2003, Charleroi, Belgium:                         6 days left



More information about the egenix-users mailing list