For the research project I am working on, I need to know which rows are affected by a sql-query. Currently I am developing a small framework, able to create select statement retrieving the id of the rows that have been affected by the processed query. I am using a sql-parser to create the corresponding query on the fly. For simple query this works fine, but the creation of corresponding select statements for complex queries is quite difficult.
For this reason I like to ask you if there is maybe an easier way to retrieve the id (rowid) of the rows that has been affected by the last query.
Returning rows "touched" by the select is tough. For the insert, update and delete you can set up triggers on the table being affected and either populate the rowids into a temp table (for insert and update) or copy the entire row into another table in case of a delete (since the rowid will be gone.)
Oracle does have a select trigger, but as far as I know it works on the entire Select statement and not row by row.
Also I am not sure how many tables you are touching, if it is a join, etc.