Re: Automatically updating Timestamp Column with DBD:MYSQL
zzapper <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 13 Apr 2005 18:57:32 -0500, wrote: >At 0:00 +0100 4/14/05, zzapper wrote: >>Hi, >>It's late (at least here in my part of the universe) but I'm >>inserting records into a mysql database >>with Perl DBI DBD:MySQL and was expecting my first & only timestamp >>field to be updated without me >>needing to specifically mention it in the insert clause, but the >>field is obstinately remaining null >> >>Any Ideas? > >Let's see the table definition. In recent versions of MySQL, >you can declare a TIMESTAMP such that it _can_ store NULL values, >and such that it doesn't automatically update. > >-- Paul I'd just declared it as a timestamp from my gui sqlyog Following your advice I then went back in and altered the field to Timestamp not Null Nothing appeared to change from my perl script From within my GUI I wrote an insert statement, which correctly inserted a timestamp. I went back to my perl script and suddenly that was working:- (Also all the Old records had a completed timestamp (today)) So I guess your >In recent versions of MySQL, >you can declare a TIMESTAMP such that it _can_ store NULL values, >and such that it doesn't automatically update. Is the solution " a nice little trap for the unwary" THNX -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/[email protected]