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
Solved

in oracle 10g how to convert  the output of ' select * from emp' to excel file

Posted on 2014-11-22
7
50 Views
Last Modified: 2016-06-11
in oracle 10g how to convert  the output of ' select * from emp' to excel file
0
Comment
Question by:priya saxena
7 Comments
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40459099
Are you using sqlplus or some graphical development environment? On which OS?
0
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 168 total points
ID: 40459385
If you are using sqlplus, you can do this to create a csv file that can be opened by Excel:

spool file.csv
select column1 || ',' ||  column2 ',' || column3
from emp;
spool off

You need to specify every column you want in the above select statement. If you have columns that contain spaces, you could add "" - like this:
(column2 is the one with spaces)

select column1 || ',"' ||  column2 '",' || column3

You can add some settings after the first spool command to get nice output:

set headsep off
set echo off
set feedback off
set linesize 1000
set pagesize 0
set trimspool on
0
 
LVL 22

Assisted Solution

by:Steve Wales
Steve Wales earned 166 total points
ID: 40459439
I normally find that for a simple query that it's easier to open Excel and import directly from MS Query.   You launch Excel, Select Data / Import External Data and then you can connect to an ODBC Data Source via the wizard that launches and it will guide you through.

Alternatively you can also use a tool Oracle SQL Developer (free)  or a paid tool like PL/SQL Developer to run the query and then export the result grid directly to Excel.
0
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.

 
LVL 29

Assisted Solution

by:MikeOM_DBA
MikeOM_DBA earned 166 total points
ID: 40462760
When using SQL*Plus, you can create XML files which are easily imported into Excel.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41649006
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41649007
There are answers given here, I suggest as solution https:#a40459385 with assist for https:#40459439 and https:#a40462760
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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

792 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