Solved

How to export query results in excel using PL/SQL in ORACLE?

Posted on 2014-03-12
3
3,806 Views
Last Modified: 2014-03-13
I am using TOAD and query results are more than toad allows to export.. Is there any alternative?
0
Comment
Question by:CalmSoul
[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
  • 2
3 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 39925719
may be you can export them into excel in subset of batches by using a where clause accordingly to restrict the record count returned. you can use one of the unique id columns or something of that sort to differentiate the batches right.

Thanks
0
 
LVL 28

Assisted Solution

by:Naveen Kumar
Naveen Kumar earned 250 total points
ID: 39925721
If you do not want to use toad export functionality at all because of the limitation, then i believe you need to code pl/sql to write into the files in the required formats. you can use utl_file package procedures/functions to write to the OS files.

Thanks,
0
 
LVL 23

Accepted Solution

by:
David earned 250 total points
ID: 39926260
Are you using TOAD simply to execute the SELECT statement, or perhaps you're adding some manual manipulation?  There may be other factors in play that restrict you.  I often debug by removing any 3rd party product and using SQL*Plus to locate syntax errors.

BTW, the current version of Oracle's (free) SQL*Developer allows a query to be run with certain hints that easily format the result set.  For example, SELECT /*+ CSV */... will forego the need to manually parse all those field delimiters.  HTML, XML, the list goes on.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

733 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