How to export query results to excel

I need to export results from a query executed with different parameter to excel using each parameter as excel file name. For example I have to run a query with parameter XXXX and export the output to a file called XXXX.xls, then execute the same query with parameter BBBB and output to a file called BBBB.xls and so on.

Can I do this using toad 9.5? I’ve looked to actions or command line execution but I’m not come up with a solution.

Thanks,

Fritz

Found a solution, from a temporary table a Toad Action export data in a fixed excel file, using a batch I call a stored procedure that empties and fills the table with data for current parameter, than I run Toad action via command line and rename the excel with parameter value. I was searching for a complete toad solution but this should do the work

Fritz