Perl DBI: $dbh->do, returning primary key of those modified
I am an extremely modular perl based CMS system that I've been producing for a couple years.
At the moment I have to clean up some code which is to do with relations across functions. For example if one function alters a content item then a relations function enumerates through sub functions that require notification of this change.
The original function runs a sub main_Relations({}) and passes those ID's that will be changed (so I have to know them before hand). It may also pass extra data.
What would really work well is if I could have the $dbh->do() function return the primary ID of those inserted/updated/deleted both before and after the SQL exec.
I could run the relations function via these two pieces of data and parsing the table name from the SQL.
Is it possible to return these two data items?
|