Solved

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

Posted on 2014-03-12
3
3,722 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
Comment Utility
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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Suggested Solutions

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
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…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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…

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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now