Recent

Author Topic: Why does GetInsertID always return 0?  (Read 147 times)

kinlion

  • New member
  • *
  • Posts: 37
  • I Love Lazarus
Why does GetInsertID always return 0?
« on: January 11, 2019, 02:36:14 am »
Hi, guys,

I'm using TMySQL56Connection, connect to a MariaDB server,  which version is 10.2.18-MariaDB-10.2.18+maria~xenial-log.
Everything is OK except when I trying to get last insert id.

I insert a record, then if I using a query 'select last_insert_id()', the result is correct.
But if I use TConnectionName(TheQuery.Database).GetInsertID, it returns 0.
What's wrong?

« Last Edit: January 11, 2019, 03:35:59 am by kinlion »
Lazarus 1.8.4 / FPC 3.0.4 / SVN 57972
On Win10 X64, have to compile for Win32