fenerlitk
fenerlitk

Reputation: 5814

SQLPLUS output: How to automatically get minimal column width for each column?

I tried set linewidth, but that wasn't my intention, is there anyway to shrink each columns width to the minimum that will fit the values? or auto substring each column so that they all fit in the screen?

thanks.

Upvotes: 6

Views: 12453

Answers (1)

psaraj12
psaraj12

Reputation: 5072

You can use

COLUMN columnname FORMAT An

for Char, VARCHAR2 (VARCHAR), LONG columns

where n is the the desired display width and columnname is a column of a table

for example

COLUMN title FORMAT a40

For different datatype like Number and other options you can refer the below link

http://ss64.com/ora/syntax-sqlplus-fmt.html

The big limitation is that you can't set an fixed width for all VARCHAR2 columns, only for specific ones.

Upvotes: 3

Related Questions