How to pass table name using the LAST_INSERT_ID keyword in MySQL?
How do 开发者_开发百科you to find last identity insert value in MySQL, with table name as parameter?
When I use the LAST_INSERT_ID()
keyword, I can't get the table name.
You can not do that, indeed.
I suggest you to work it at the application level - in PHP/Python/Ruby/Perl, etc
There is no such functionality, due to scope issues.
Without calling LAST_INSERT_ID
in the context of a transaction, there is no way to know if the value is actually related to your insert or someone else's.
精彩评论