formating sql output [message #368400] |
Wed, 13 December 2000 10:28 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
TLT
Messages: 2 Registered: December 2000
|
Junior Member |
|
|
Below is the result set from a sql query:
ID TYPE
---------- ----------
NAME
------------------------------------------
41228 41225
Guests
My question is how can I get the data to show directly below the column heading. I'm dealing with very large varchar2 columns and it is very difficult to see what variables belong to the column headings. I know there is a command to remedy this, but I can't remember what it is.
Thanks
|
|
|
Re: formating sql output [message #368401 is a reply to message #368400] |
Wed, 13 December 2000 11:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Bala
Messages: 205 Registered: November 1999
|
Senior Member |
|
|
Hi,
You can set the line size to a large number and spool the output to a file.
from sqlplus
SQL> set line size 150
SQL> spool c:\spool.txt
SQL> select.......
SQL> spool off
or you can use substr function to restrict the length of each column in the display
like
SQL> select substr(ID, 1, 10) ID, substr(TYPE, 1, 5) type .....etc
|
|
|
|