MySQL, unfortunately, currently doesn't implement a SQL statement that
allows for fetching the last inserted ID in one go (like, e.g. Firebird,
PostgreSQL, Oracle, DB2, and others). One option how you could work around
this would be to create those exact two statements you've mentioned and
"batch" them using the plain SQL API, calling ResultQuery.fetchMany() - in
case of which you'd get all the results. Along the lines of this:
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to [hidden email].