Is it possible to create the behaviour of a sequence with SQLite?

I need to do something like this:

[pseudocode]
var id = SELECT next_val FROM my_sequence;
INSERT INTO table1 VALUES(id, ...);
INSERT INTO table2 VALUES(id, ...);

This should return the next value, AND also increment it so that the next
call will
be +1. (I'm then taking this value and using it as key for a row inserted
into multiple tables).

I read the docs as well as searched the mailing list archives, but didnt'
find much. There was something about using triggers, but would this
guarantee an atomic increment?

Does anyone have a solution to this?

Thanks,

Dave

Reply via email to