Reserving mySQL auto-incremented IDs?

前端 未结 3 1956
既然无缘
既然无缘 2021-02-15 14:15

We want to obtain an auto-increment ID from mySQL without actually storing it until the other non-mysql related processes are successfully completed, so that the entry is not st

3条回答
  •  无人共我
    2021-02-15 15:11

    you can use temporary table along with transaction

    if transaction complete temp table will be gone and move data to real table

    http://www.tutorialspoint.com/mysql/mysql-temporary-tables.htm

提交回复
热议问题