Solved

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

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Optimize the query 5 43
update statement in oracle 9 29
return value in based on value passed 6 28
MYSQL responding very slow 3 24
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
'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 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 explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

829 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