Current Timestamp upon creating of a record

2004-12-18 Thread Frank Fischer
Hi all i would like to create a Timestamp upon initial creation of a record. I expected this could be done using now() in my INSERT statement but obv. the related field gets actualised each time a record is updated. Unfortunately that's not what i like - i would like to have the timestamp set

Re: Current Timestamp upon creating of a record

2004-12-18 Thread Jigal van Hemert
i would like to create a Timestamp upon initial creation of a record. I expected this could be done using now() in my INSERT statement but obv. the related field gets actualised each time a record is updated. Unfortunately that's not what i like - i would like to have the timestamp set just

Re: Current Timestamp upon creating of a record

2004-12-18 Thread Michael Stassen
If you are using 4.1.2 or later, you can define the default and update behavior separately for TIMESTAMP columns with the DEFAULT and ON UPDATE clauses. CREATE TABLE t (ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, ... In this example, column ts will be set to now on creation (INSERT) because of