[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register 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,352 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

650 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