in reply to last_insert_id did not work
Note that last_insert_id has quite a few caveats including:
For some drivers the value may only be available if placeholders have not been used (e.g., Sybase, MS SQL). In this case the value returned would be from the last non-placeholder insert statement.
For this reason I prefer to get the database do provide the information rather than the driver.
my ($_cinsert) = $dbh->selectrow_array("SELECT LAST_INSERT_ID()");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: last_insert_id did not work
by bizactuator (Sexton) on Mar 27, 2021 at 22:36 UTC | |
by Bod (Parson) on Mar 27, 2021 at 23:23 UTC | |
by bizactuator (Sexton) on Mar 28, 2021 at 04:37 UTC |