> I have been looking through the soci documentation for something that
> acts like LAST_INSERT_ID(), but a database independent soci call instead
> of that one; all I could find is the 'rowid' struct. rowid is good but
> it does not work for mysql (That's what the error message said). I am
> just wondering if there is a soci way of getting the id of the last row
> you inserted?

There ain't and there can't be. LAST_INSERT_ID is a non-standard SQL
extension. Some databases support equivalent mechanisms but not all
and in any case the semantics of what that is even supposed to do
aren't well defined. I'd advise against using auto_increment or
identity or whatever your db calls them columns in general. Joe
Celko offers some strong words of advice on that particular topic ;-)

What are you trying to do with the id? Is there no alternative way
to word the SQL?

best regards,

    Sören

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to