?
Solved

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

Posted on 2014-03-12
8
Medium Priority
?
6,068 Views
Last Modified: 2014-12-06
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
Comment
Question by:manivinesh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 7

Assisted Solution

by:Kishan Zunjare
Kishan Zunjare earned 500 total points
ID: 39925578
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
 
LVL 12

Assisted Solution

by:Praveen Kumar Chandrashekatr
Praveen Kumar Chandrashekatr earned 500 total points
ID: 39925718
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
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 39926017
>> a procedure
How are you going to run this procedure? From SQL Developer, from a DBMS job, shell script or other way?
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 23

Assisted Solution

by:David
David earned 500 total points
ID: 39926283
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
 

Author Comment

by:manivinesh
ID: 39928089
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
 
LVL 32

Accepted Solution

by:
awking00 earned 500 total points
ID: 40053907
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

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question