On Nov 17, 2008, at 12:45 AM, [EMAIL PROTECTED] wrote: >> I am addicted to using INTEGER PRIMARY KEY AUTOINCREMENT as the id >> fields in my SQLite projects, yet I would like to try some triggers >> as >> well. Of course, every time I add a trigger that accesses a table >> with these types of id fields, all sorts of odd things happen. I >> read in the documentation about simply using PRIMARY KEY instead of >> INTEGER PRIMARY KEY, but then I lose my AUTOINCREMENT ability. > > To clarify, do you mean that an automatically generated autoincrement > value is not available in BEFORE INSERT triggers? > > Presently, it is only available in AFTER INSERT triggers. > > Dan.
Dan: Yes, I was using the AFTER INSERT on the trigger. Please see my followup posting in Issue 49, message number 1. I posted a clarification of the odd behavior I am observing. > > >> Does anyone have a solution that both provides AUTOINCREMENT (or a >> reasonable facsimile) to a PRIMARY KEY field and allows the usage of >> triggers on those tables? >> >> Thank you very much. >> >> Craig Smith > Craig Smith [EMAIL PROTECTED] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users