Solved

sql*plus output a mess

Posted on 2014-02-20
3
429 Views
Last Modified: 2014-02-20
I have asked our DBA to run a query
spool c:\report.csv
select * from mytable

however, the output is a complete unreadable mess, not aligned into a

column 1 column 2 column 3
-------------------------------------------------

type format. Is this common qwith sql*plus. Is there anyway within sql*plus to get the results into a readable format, or are you better with an alternative tool?
0
Comment
Question by:pma111
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 500 total points
Comment Utility
use toad or pl/sql developer which have easy options to generate csv files.
0
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
if you wanted to do it with sql*plus, then prepare the query in the format as given below accordingly and then try to see if that can help.

you will also have to setup column headsing, page, lines with the SET sql*plus commands

set heading ...
set page ...
etc

select column1 || ',' || column2 || ',' || ....
from you_table

Kindly ensure that you use cast/to_char accordingly for date/timestamp columns as per your requirements.

Thanks,
0
 
LVL 3

Author Comment

by:pma111
Comment Utility
you may wish to chip in on this question http://www.experts-exchange.com/Database/Oracle/Q_28369582.html
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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
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 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 shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

762 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

6 Experts available now in Live!

Get 1:1 Help Now