Yes, that's what I'm talking about. Only one column can have this current_timestamp as default statement.

From: [EMAIL PROTECTED]
To: Lieven De Keyzer <[EMAIL PROTECTED]>
CC: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 19:57:43 +0200

Hi,
look at default initialised to current_timestamp. you ca see also on update :


http://dev.mysql.com/doc/mysql/en/timestamp-4-1.html

Mathias

Selon Lieven De Keyzer <[EMAIL PROTECTED]>:

> I 'm writing a webapplication in Java that allows users to store bookmarks.
> The system scans these pages for differences at user-selected intervals. At
> another user-selected interval, the system sends notification mails about
> changed bookmarks. The bookmark table provisionally looks like this:
>
> CREATE TABLE bookmark (
> bookmark_id INTEGER NOT NULL AUTO_INCREMENT,
> bookmarkname VARCHAR (80) NOT NULL,
> url VARCHAR (150) NOT NULL,
> folder_id INTEGER NOT NULL,
> last_scanned TIMESTAMP NOT NULL,
> PRIMARY KEY (bookmark_id),
> FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE CASCADE)
> TYPE = InnoDB;
>
> I want to add another TIMESTAMP column, last_notified. But whenever I insert
> a new bookmark, the first TIMESTAMP column will be set, the other will be
> 0000-00-00 00:00:00.
> When they get mapped by the iBatis framework to Java objects, I get an
> exception that aTimestamp object can not be created with 0000-00-00 00:00:0
>
> Is there a way I can set them both when the bookmark is created? I rather
> not set one of them to NULL, because that would imply a lot more code to
> check if a user should be notified or a bookmark should be scanned.
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>
>






-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to