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

M.-A. Lemburg mal@lemburg.com
Wed, 26 Mar 2003 13:33:42 +0100


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