On 11 Jul 2010, at 6:46pm, Sam Carleton wrote:

> I have some audit fields, one being updatedby, I would like to create an
> update trigger that would prevent the row from being updated if this was not
> set.  Can I do that in sqlite?

Use a TRIGGER on BEFORE UPDATE.  In the TRIGGER check that new.updatedby is not 
a blank and if it is RAISE a FAIL.

<http://www.sqlite.org/lang_createtrigger.html>

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

Reply via email to