I got the task to update a rather big file that consists of many update and delete statements.
First things first would be to check, which statements are actually needed / used.
I would like to spool this into a separate file, but it is difficult to get it into a nice format.
For example:
set serveroutput on
spool xxx.csv
update xx set yy where a = b;
Creates a file like:
sql: update xx.....
1100 rows updated.
The closest i got to my desired output is to use something like:
spool xxx.csv
select 'update xx set yy where a = b;' query, count(x) count from xx where (update where clause)
This would work mostly well (except for multiline queries), but it would require me to rewrite all update / delete statements and there are a lot.
Does anyone have an idea how I could solve this the best way? The best outcome would be a file like:
Query Count
update xx ... 1100
Thanks in advance!