Automated export to Excel from set of DBs

Is it possible to run the set of queries and have automatically an Excel file generated from all result sets for couple databases?

My use case:
Let's say I have a dummy SQL file with the following content:

SQL:
-- Excel = c:\Exports\%yyyy%_%mm%_%dd%\%dbname%_%yyyy%_%mm%_%dd%_-_%hh%_%mi%.xlsx
-- Tab = X
-- Records = all
select *
from   dual;
-- Tab = Y
-- Records = all
select sysdate
from   dual;

I need to run the above on over a dozen of DBs and collect the results to Excel files. I do it currently DB by DB, switching connection, running the set of queries and then right mouse clicking on the dataset → Copy all to Excel... My real life queries are time-consuming, so I switch back and forth between a couple instances of PL/SQL Developer connected to separate DB's. How to do it better?
 
Last edited:
This cannot be automated in PL/SQL Developer. It requires an explicit export action for each result set.
 
Maybe I could create a small plug-in running the queries set given by the command line parameter and then export the result set using a popup menu hook? All called automatically, after the connection is established. Would it be possible?
 
Last edited:
I'm not sure if this is possible, and if it is, it would of course take a lot of time to create such a Plug-In. It would probably be easier to create a standalone command-line tool to to perform a query and export the results to excel (or csv), and call it for each database connection.
 
Back
Top