On Nov 16, 2008, at 2:46 AM, Craig Smith 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.

> 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
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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

Reply via email to