MontyPython
MontyPython

Reputation: 2994

Can Data Export from SQL Developer to Excel be scheduled?

I have to run almost 50 queries daily for daily reports and copy-paste the data into Excel sheets. Is there a way to schedule a job on SQL Developer that exports data from all the queries in an Excel Workbook?

Upvotes: 2

Views: 10040

Answers (2)

ChrisProsser
ChrisProsser

Reputation: 13088

I would advise using your operating system to schedule the task. Assuming that this is Windows (as you want to write to Excel) then you can use Task Scheduler to set off a cmd script or powershell script which can call SQLPLUS passing in a parameter for the the sql file that you wish to run. It would not be too difficult to output this to a CSV file which can be opened in Excel. If you actually need to write the data to a .xlsx (or similar) file then there are options (e.g. Python libraries that can do this), but it will not be as straight forward.

I am not sure exactly what part of this you need help with, so can I suggest that you consider the steps below, if you want to proceed do some research and have an attempt at each step and then post a question for each that you are stuck on with details of what you have tried:

  1. Schedule a job from your operating system;
  2. Write a script to call SQLplus and execute a .sql file;
  3. Change query output to csv and redirect to file (or find a way to write directly to an Excel file if this is what you need to do);

Upvotes: 1

bushell
bushell

Reputation: 550

You could link the excel spreadsheets to your queries so they automatically update themselves.

Insert > Data from External Source. I do this with SQL Server a lot, and you can do it with Oracle too if you know the connection strings.

I would comment, but I dont have the rep yet.

Upvotes: 2

Related Questions