chris_jay
chris_jay

Reputation: 65

How to format the columns in sqlplus while displaying it in the terminal?

I was using the HR account in the Oracle DB XE on Ubuntu. So I am running the SQL*Plus in the terminal. I know that the maximum displayable linesize is 150 without wrapping but when I display the employee table in the terminal the last two columns end up wrapping around. I have

set lines 150;
set trimout on;
set pagesize 10000;
set tab off;
set wrap on;

and I am seeing displaying the columns

as you can see here the columns LAST_NAME, EMAIL, HIRE_DATE are taking extra blank spaces which could be other wise utilized for displaying the columns which get wrapped. I tried flicking the wrap on and off and that doesn’t help either. How can I optimize the space consumed as I am also spooling the file and the output is very confusing to look at.

Upvotes: 3

Views: 17334

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133360

try adding

COLUMN LAST_NAME FORMAT A10 

/

for limit to 10 alfanum char

Upvotes: 2

Related Questions