0

I am trying to display tables in Oracle properly, but it only shows one column each row.

    SQL> select * from Manager;

FAMILYNAME
--------------------------------------------------
PERSONALNAME
--------------------------------------------------
    SALARY
----------
Sung
Sam
     56000

Smith
Darwin
     54000

P. Fries
Chris
     63000

Williams
Sean
     43000

I tried to adjust linesize and pagesize, but it doesn't help. Is there anyway that I can let it print table properly?

  • You have the answer to your immediate question, correctly provided by @Littlefoot, but allow me to explain what's going on here. Lacking the column format spec (per Littlefoot), sqlplus will need to allocate space for the full potential width of the column, regardless of the actual length of resulting data. And your command-line window is usually hard limited to 80 characters. LINESIZE tells sqlplus where to unconditionally insert a newline, but if that is greater than the 80-character width of the window, you will get a line wrap imposed there, outside the control of sqlplus. – EdStevens Oct 26 '21 at 22:11

1 Answers1

0

Yes; specify column format, e.g.

col familyname format a15
col personalname format a15

Then run the select statement again.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57