When using mysql.h
, there's a property called insert_id
on the MYSQL
connection object. Is there a similar feature when using a TADOConnection
?
I am well ware of SELECT LAST_INSERT_ID();
. What I'm asking is: If the C API has that feature, why is that feature missing in the ADO connector, if missing?
And if the only solution is to INSERT
and SELECT
the last insert id, are these two queries atomic, can some other INSERT
queries be executed in-between, from a different connection, and make LAST_INSERT_ID
return an unexpected value?
Since SQL-Server has OUTPUT Inserted.ID
and Postgres has RETURNING id
, I find MySQL to have made a dumb design choice with LAST_INSERT_ID()
.