Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7277
  • Last Modified:

Export Query result inside a procedure to Excel file In Oracle SQL Developer

Am using Oracle SQL Developer

Am trying to write a procedure which exports the result of the select query inside to a excel file. It should create a new excel file and write the output on it.

Is there any way to do it? Please suggest.
0
manivinesh
Asked:
manivinesh
4 Solutions
 
Kishan ZunjareSr. Software EngineerCommented:
Export oracle sql output to excel format.

Simple way to convert the sql results to excel format

http://www.genlinux.org/2011/03/converting-oracle-sql-output-to-excel.html
0
 
Praveen Kumar ChandrashekatrDatabase Analysist Senior Commented:
You have to use UTL_FILE package to get the outputs in excell sheet. here is the doc for your refference.

https://community.oracle.com/message/11052667

https://community.oracle.com/thread/2286974?start=0&tstart=0

Also you can directly export the output of the SQL statement in SQL Developer using upload option when we right click on the o/p window of SQL developer tool.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
>> a procedure
How are you going to run this procedure? From SQL Developer, from a DBMS job, shell script or other way?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
DavidSenior Oracle Database AdministratorCommented:
Gerwin, the author states up front it's SQL*Developer :)

Because of that, I refer my fellow experts and the asker to that tool's "secret" hints.  Manual formatting of the output can be replaced with a short string.  From the source:
Capture.PNG
0
 
manivineshAuthor Commented:
Dear Experts,
Thanks to all your suggestions, It's kind of complicated to me... Let me be more specific...

Tables : Employee, EmployeeReport

1. I need to create one excel/csv file for each employee
2. Am trying to loop the Employee Table through Cursor and inside the loop,
3. I want to write a select query to EmployeeReport, the result set of this query has to be exported to csv/excel file.
0
 
awking00Commented:
I've always found it easier to open up Excel and import the database query rather than the other way around. In
Excel, select Data, Import External Data, New Database Query, connect to the database, then follow the query wizard.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now