Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQLPlus formatting chaos
Hi
Oracle 8.0.5 / Linux SuSE 6.0
I am really not an expert concerning SQLPlus, but at least I took some time to read the docs concerning output formatting, but I can't figure out how to teach SQLPlus to do something very basic: just print out everything correctly aligned. Hopefully someone can explain how to do this.
Here is what I expect SQLPlus to do:
COLA COLB COLC
----------- ----------- ----------------- abcd efghijkl mnopqrstuvwxyz 1234 567890
Here is what SQLPlus usually does here:
COLA COLB COLC
----------- ----------- ------------------ abcd efghijkl mnopqrstuvwxyz 1234 567890
If columns are empty (or very short), then the next columns simply get shifted to the left. The headers and data are inconsistent with the '-----' separator areas. Actually the '-----' area is the only thing which is correct when looking at the size of the database columns.
I tried all sorts of commands and parameters, such as the COLUMN command with the FORMAT and HEADING parameter, but whatever I do I still get the same chaos. SQLPLUS ignores my desired field widths except for the '-----' areas, which are updated correctly. If I use 'rpad' then I can achieve at least alignment of the actual row elements, but the headers are still completely misplaced. I even can't imagine where SQLPlus takes the difference between the header elements from.
Even an example in the Oracle docs show the same misalignment ( at least concerning the header fields).
Department Employee Salary Commission ---------- ---------- ---------- ----------
30 ALLEN 1600 300 30 WARD 1250 500 30 MARTIN 1250 1400 30 TURNER 1500 0
It would be very nice, if someone could tell me those magic commands to achieve usable formatting.
Thanks in advance.
bye
--
Sam Jordan
Received on Mon Jan 10 2000 - 07:02:58 CST
![]() |
![]() |