Re: Adding TIMESTAMP Column to MySQL Table
Posted by: Martin King-Turner
Date: November 24, 2005 08:05AM

The DDL for the timestamp column is:

`ColumnName` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Unfortunately, if you add a TIMESTAMP column to an existing table, MySQL doesn't populate it with any data, even if the default is CURRENT_TIMESTAMP. You therefore have to populate it manually:

UPDATE `TableName` SET `ColumnName`=NOW();

If you don't populate it, MS Access will be unable to update the record.

To avoid these steps, I've enhanced the MigrationAccess class of the Migration Toolkit to provide an additional table migration method for Access databases. This class creates (and populates) the extra timestamp column for you during the migration process. I'll email a couple of files to you in case you want to use it.

Options: ReplyQuote


Subject
Written By
Posted
Re: Adding TIMESTAMP Column to MySQL Table
November 24, 2005 08:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.