Extract excel/csv file from database query browser

Hi everyone,
I need to extract an excel or csv file from database. Currently, I selected data from Database Query Browser and I saved data by coping and pasting them in an excel file. Is it possible to generate directly a file and to download it? How can I do it?
Thanks in advance.

In a script, use a named query to fetch the data, system.dataset.toExcel() to convert it and either system.file.writeFile() for vision or system.perspective.download() for perspective to get the file to the end user.