[Zope-DB] Error Value: Invalid value, 0000-00-00, for ...

Alex Cowan alex@funcom.com
Wed, 26 Mar 2003 12:49:21 -0000


This happens because you have put null into a not null column with the
default '0000-00-00 00:00:00' which is the standard default when no default
is given.

Alex

----- Original Message -----
From: "M.-A. Lemburg" <mal@lemburg.com>
To: "Charlie Clark" <charlie@begeistert.org>
Cc: <zope-db@zope.org>
Sent: Wednesday, March 26, 2003 12:33 PM
Subject: Re: [Zope-DB] Error Value: Invalid value, 0000-00-00, for ...


> Charlie Clark wrote:
> > On 2003-03-26 at 13:15:07 [+0100], Frerichs, Thomas (CONS FIN) wrote:
> >
> >>Hi all,
> >>
> >>I try to select some data out of a MySQL database which contains a
column
> >>suspension_date of type date.
> >>Now when suspension_date is NULL the retrieved data for that column is
> >>'0000-00-00'. This raises the following error in Zope: Error Type:
> >>ValueError
> >>Error Value: Invalid value, 0000-00-00, for suspension_date in record 0
> >>
> >>I didn't found any information how to work around this problem. I found
a
> >>similar problem description in a German mailing list but nobody sent a
> >>solution yet.
> >>I use:
> >>Zope 2.6.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32;
> >>ZODBCDA-3.1.0b2-win32-py21;
> >>MySQL 3.23.54-win and
> >>MyODBC-3.51.06
> >>
> >>Has anyone an idea how to explain Zope that a date '0000-00-00' is a
NULL
> >>value?
> >
> > No, but you might want to try using the mxODBC driver and DA as it looks
> > like ZODBCDA / MyODBC are not working properly. I've had no problems
with
> > NULL dates in MySQL when using the Python MySQL driver.
>
> That's really a problem with MySQL. I'm not sure how the new
> MyODBC driver deals with this, but the old one definitely returned
> 0000-00-00 as well. mxDateTime happily accepts this date, but the
> conversion to Zope's DateTime which is done to be more compatible
> to ZODBC will fail with mxODBC Zope DA too.
>
> --
> Marc-Andre Lemburg
> eGenix.com
>
> Professional Python Software directly from the Source  (#1, Mar 26 2003)
>  >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
>  >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
> ________________________________________________________________________
> Python UK 2003, Oxford:                                      6 days left
> EuroPython 2003, Charleroi, Belgium:                        90 days left
>
>
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
>