|
From: Michel B. <mi...@bo...> - 2005-06-06 14:19:01
|
Le Dimanche 05 Juin 2005 20:15, Lionel Bouton a =E9crit : > > CURRENT_TIMESTAMP won't work with SQLite. If I need to change the table > creation, I'd better change the order of the columns. Another method would be to specify "default 0" for all timestamps, and th= is=20 should prevent them to be auto-updated. > Although I have found another way: if the UPDATE statements are modifie= d > to look like: > UDPATE <awl> SET first_seen =3D first_seen, last_seen =3D <now> WHERE > <cond>. MySQL doesn't change first_seen (at least 4.1.12 doesn't). As > the 2 timestamp columns are forced, I can't imagine a way for any MySQL > version to change the values. > > This is a quick fix, won't create ugly special cases and the database > system will probably optimize the query properly. This looks good as well, provided every "UPDATE" statements is modified t= his=20 way. Maybe a combination of specifying "default 0" for the timestamps and= =20 using this method could help accomodate with every SQL variant ? --=20 Michel Bouissou <mi...@bo...> OpenPGP ID 0xDDE8AC6E |