mysql> 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 DATETIME DEFAULT NOW(),
-> last_notified DATETIME DEFAULT NOW(),
-> PRIMARY KEY (bookmark_id),
-> FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE CASCADE) TYPE = InnoDB;


ERROR 1067 (42000): Invalid default value for 'last_scanned'

From: Simon Garner <[EMAIL PROTECTED]>
To: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Thu, 19 May 2005 09:52:02 +1200

Lieven De Keyzer wrote:

But how do I initialize the 2 datetime fields? With no DEFAULT, their values are 0000-00-00 00:00:00. Just what I wanted to avoid with TIMESTAMP



Set their value to NOW() if you want the current date/time.

-Simon

--
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