Discussion:
[soci-users] last insert row id
Witold E Wolski
2013-09-24 20:27:16 UTC
Permalink
How to get the id of the last inserted row?

regards
--
Witold Eryk Wolski
Mateusz Loskot
2013-09-24 20:45:29 UTC
Permalink
Post by Witold E Wolski
How to get the id of the last inserted row?
See session_backend class definition, two get_* methods with related comments.
Keep in mind, this is backend-specific behaviour,

For SQLite3, it has been implemented in pull request
https://github.com/SOCI/soci/pull/184/
but not yet merged (I will merge it during next days, release in SOCI
3.3.0 or 3.2.3)
Note, #184 is closed, but being split into separate pull requests to
be posted soon.

Meanwhile, patch your SOCI with definition from
sqlite3_session_backend::get_last_insert_id
(see https://github.com/SOCI/soci/pull/184/files)

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
"Participation in this whole process is a form of torture" ~~ Szalony
Loading...