Solved

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

Posted on 2014-03-12
3
3,761 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
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…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

785 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