[Tutor] MySQLdb table is DATE, but SELECT returns with TIMESTAMP.

Decibels decibelshelp@charter.net
Wed Jun 18 17:47:05 2003


Thanks, it was just my lack of understanding.  I do hope that Python 2.3
does separate date and datetime classes. Though it isn't that big a deal
now that I see what it going on.

>Sure, in the database end of the connection, this is how it works.
>I the Python end, the mx.DateTime type called DateTime is used, and
>its just one type. Dates are simply DateTimes where the time-part
>is 00:00:00.0 in mx.DateTime.

>When Python 2.3 is established, I guess that many database drivers
>will support the new standard datetime module in Python, and then we
>will have separate date and datetime classes.

I was trying to refer to the mx.DateTime doing what it does, even
though I didn't store the time-part in the database. I guess I failed, but
understand it now.

>>   Even if it isn't behaving in a
>>manner that seems inconsistent with MySQL itself and just 'TAGGING'
>>a default timestamp when it retrieves the date. Even though it wasn't
>>stored that way. I still probably need to learn to use the mx.DateTime
>>module.

>Now I lost you...

Yes, I had some test statements in there to see what was going on and
it got screwed it up a little. I did delete the row I wanted, based on matching
symbol, name, date.  Messed up one of my conditionals while testing and
it was just saying it didn't find a match. Ooops.

>>I am still playing with it. Seems that what I did earlier sort of worked, or
>>I borked the code a little later. But when I was testing, I just had one row
>>now I have two and it says no matches, so won't delete.  So have to
>>see why it isn't matching, probably typo. But would have been less
>>troublesome to start with if it retreived the date like I stored it.

>I guess you did something wrong. If two rows match the WHERE clause
>of a DELETE statement, both rows should be deleted.

Dave