in reply to Class::DBI vs DBD::ODBC

The latest release of DBI introduced a new method to get the last insert id.

See the announcement in the Changelog.

However, the DBI documentation warns that this method is heavily influenced by driver implementation.

Check out this piece of advice from the DBI docs. It may be able to meet your needs. I didn't test it.

* Some drivers may need driver-specific hints about how to get the value. For example, being told the name of the database 'sequence' object that holds the value. Any such hints are passed as driver-specific attributes in the \%attr parameter.