Home » SQL & PL/SQL » Client Tools » sqlplus table output
sqlplus table output [message #290148] Thu, 27 December 2007 13:31 Go to next message
eboraks
Messages: 4
Registered: December 2007
Junior Member
Hello there, i am new to Oracle and I have been looking for a way to organized the output that I am getting from oracle.

Below is a sample of the output I am getting from select statement. I would like to know if there is any way to make it more organized?

PROJECTNO MEMBERNO PROJECTNAME
---------- ---------- ----------------------------------------
PROJECTDESC
--------------------------------------------------------------------------------
MUSICDIR
--------------------------------------------------------------------------------
PROJECTDA
---------
2000001 1000000 From where I am
Personal interpretation of classic Jazz standards
root/2000001
27-DEC-07


Thank you in advance

Re: sqlplus table output [message #290149 is a reply to message #290148] Thu, 27 December 2007 13:49 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What do you mean more organized?
Have a look at SQL*Plus parameters:
SQL*PlusŪ User's Guide and Reference
Chapter 12 SQL*Plus Command Reference
Section SET System Variable Summary

For instance, "set linesize" let you specify your line size.

COLUMN allows you to specify column format.

Regards
Michel

[Updated on: Thu, 27 December 2007 13:50]

Report message to a moderator

Re: sqlplus table output [message #290156 is a reply to message #290148] Thu, 27 December 2007 17:01 Go to previous messageGo to next message
eboraks
Messages: 4
Registered: December 2007
Junior Member
Thank you.

The problem got solved when I inserted the sample below into the
login.sql file.


column ColName format A10
....
....
Re: sqlplus table output [message #290213 is a reply to message #290156] Fri, 28 December 2007 00:25 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Into the LOGIN.SQL? You might be surprised in a month or two when another query selects data from another table with the same column name (and you'll, of course, forget what you've done yesterday).
Re: sqlplus table output [message #290346 is a reply to message #290213] Fri, 28 December 2007 07:28 Go to previous messageGo to next message
eboraks
Messages: 4
Registered: December 2007
Junior Member
So you suggest to put in just before the SELECT statement?
Re: sqlplus table output [message #290349 is a reply to message #290346] Fri, 28 December 2007 07:41 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I think that it would be a better idea.

Or, if you decided to store a query into a file, save desired settings with it, such as
REM My query.sql

SET NUMFORMAT 999D99
SET PAGESIZE 20

COLUMN name FORMAT a8

SELECT name, ...
FROM ...
Re: sqlplus table output [message #290351 is a reply to message #290349] Fri, 28 December 2007 07:47 Go to previous message
eboraks
Messages: 4
Registered: December 2007
Junior Member
Thank you for the tip.
Previous Topic: Difference between DEFINE and VARIABLE
Next Topic: Tool to do syntax check on DML/DDL
Goto Forum:
  


Current Time: Thu Dec 08 12:12:38 CST 2016

Total time taken to generate the page: 0.05059 seconds