Toad World® Forums

How do I export to excel from PL/SQL

I’m using TOAD for Oracle and it has a interface that allows me to indicate a speadsheet, an instance(tab) name and a few other items to export the results of a query directly to excel.

I have a few SQL statements that I wish to run from PL/SQL and have them automatically exported to an Excel file with a given filename and tab name.

I think I need to write a PL/SQL procedure that does this and then call that from the TOAD Scheduler (or is there an easier way?)

If so, how do export the results from a query to a specific excel file/tab from PL/SQL?

You can use Toad automation to run any series of PL/SQL and then export the final results to an Excel spreadsheet. You have two options, Select to file and the Exprort Wizzard. Depending on what version of Toad Data Point you are on Select to file will work a little different. You many need to use the advanced button on the newer versions to name the tab etc. but both methods allow you to point to a sql file or just type in the code. Then you can schedule the Toad automation job to run at a predetermined time each day/week/month/etc.