Hi,
how can we get the last inserted ID from MariaDB/MySQL ?
sending a query one by one does not work for LAST_INSERT_ID
e.g.
followed by:
will return always 0 (zero)
request everything at once returns the correct ROW number:
question is how to write the SQL statement in config.properties?
how can we get the last inserted ID from MariaDB/MySQL ?
sending a query one by one does not work for LAST_INSERT_ID
e.g.
B4X:
request: INSERT INTO books (title) VALUES ('test');
B4X:
request: SELECT LAST_INSERT_ID();
request everything at once returns the correct ROW number:
B4X:
request: INSERT INTO books (title) VALUES ('test');SELECT LAST_INSERT_ID();
question is how to write the SQL statement in config.properties?
B4X:
sql.insert_books = INSERT INTO books (title) VALUES (?);SELECT LAST_INSERT_ID();