Hi,

I've recently started to play around with SQLite and I'm currently trying to 
create a trigger for updating a timestamp field inside a table (SQL-syntax for 
the creation of the table is included below.) Could someone please tell me how 
I should go about writing such a trigger. I'd like the [updated]-field to be 
set to the current timestamp everytime an entry is updated/modified.

Thanks! 

/Kris

CREATE TABLE IF NOT EXISTS Entries (
entryID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
title VARCHAR(50) NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
signature VARCHAR(25) NOT NULL,
body TEXT NOT NULL);

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to