Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2014-03-12
8
Medium Priority
?
6,553 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
6 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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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 series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

810 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