On 27-11-2007 13:13:13 -0700, m h wrote:
Thanks much for the responses.
Sorry to beat a dead horse.... (Am currently in the process of simulating AUTOINC and SERIAL with SEQUENCES as suggested, since the ORM part of SQLAlchemy relies heavily on knowing the id).
So let me rephrase my question to try to eliminate the concurrency issue. Is is possible to get the ID of the item I recently inserted (ignoring that others might have inserted them). Perhaps the concurrency can't be eliminated here, since the cursor doesn't know the id, it's all server side.
Hope I'm not being too annoying, I'm just trying to understand how things work.
As far as I am aware, the problem should be solved in the same was as it is done for PostgreSQL, as it uses the same (SQL standard) strategy. Last time I checked, they didn't have a method either to retrieve the last id value. I don't know if we have currval() implemented, but I guess we could, and it might solve your problem at this level. http://www.postgresql.org/docs/7.4/interactive/functions-sequence.html