Heikki Tuuri wrote:
> the FIRST column declared to have the type
> TIMESTAMP in a table is the automatically updating
> one. You do not specify any default value, the
> type TIMESTAMP itself means it is automatically
> updating.
Further, if I create a table with the definition:
CREATE TABLE CHType
(
iCHTypePK BIGINT(20) NOT NULL AUTO_INCREMENT,
cCreditHourTypeName CHAR(30) NULL,
iUserFK BIGINT(20) NULL,
tChanged TIMESTAMP(14) NULL,
PRIMARY KEY (iCHTypePK)
)
TYPE= InnoDB
;
Executing INSERT commands leave the TIMESTAMP field untouched:
mysql> insert into CHType (cCreditHourTypeName, iUserFK) values ("Credit Hour", 1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into CHType (cCreditHourTypeName, iUserFK) values ("Life", 1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into CHType (cCreditHourTypeName, iUserFK) values ("Property/Casualty", 1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into CHType (cCreditHourTypeName, iUserFK) values ("Annuity", 1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into CHType (cCreditHourTypeName, iUserFK) values ("Ethics", 1);
Query OK, 1 row affected (0.00 sec)
mysql> select * from CHType;
+-----------+---------------------+---------+----------+
| iCHTypePK | cCreditHourTypeName | iUserFK | tChanged |
+-----------+---------------------+---------+----------+
| 1 | Credit Hour | 1 | NULL |
| 2 | Life | 1 | NULL |
| 3 | Property/Casualty | 1 | NULL |
| 4 | Annuity | 1 | NULL |
| 5 | Ethics | 1 | NULL |
+-----------+---------------------+---------+----------+
5 rows in set (0.00 sec)
Ted Roche, MCSE, MCSD
Ted Roche & Associates, LLC
http://www.tedroche.com