Hi all,
I have a number of tables that I want 'timestamped' with both a
modified and created 'timestamp' field.
Ideally both fields should 'work if ignored' in insert and updates,
thus the following is fine for a modified timestamp field tsm:
tsm timestamp default current_timestamp on upate current_timestamp
But is there a way to create a field that in effect is 'write once'
and contains the creation timestamp ? In a sense I want some thing
like (psudo sql create line):
tsc timestamp default current_timestamp 'on_update_do_nothing'
I think a second timestamp with 'default current_time' would help but
mysql does not allow this - (I have no idea why !?)
There are quite a number of tables and I want to avoid 'table
specific' sql code like the following (psudo sql):
insert record ...
get last update auto increment key
select modifed timestamp value from key record
update key record create timestamp field with timestamp
Any ideas (for a 'write once' creation timestamp)?