Menu

Last inserted row

Help
2010-08-11
2013-04-02
  • Christoffer Andersson

    Hello.
    I wonder if there is a good way to get the id of the last inserted row.
    I see that there is the LastInsertId property in TMySQLClient, but when you use the client as a global object (since i dont want to start a new connection for every object that communicates with the MySQL server) i cant be sure that the ID corresponds to the insert i did.
    Wouldt it be better to have that property as a part of the result when doing a INSERT query…

     
  • GuiLaiN

    GuiLaiN - 2010-11-13

    Hello,
    if you have several threads, you could use critical sections.
    G.

     

Log in to post a comment.