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.
You can change the displayed width of a datatype or DATE, by using the COLUMN command with a format model consisting of the letter A (for alphanumeric) followed by a number representing the width of the column in characters. If you specify a width shorter than the column heading, SQL*Plus truncates the heading.
Answer: There are many ways to determine the length of a specify column, and it depends on the datatype. Current to the last run of dbms_stats, you can use the DBA_TAB_COLUMNS view, using the AVG_COL_LEN or CHAR_COL_DECL_LENGTH columns.
The PAGESIZE setting tells SQL*Plus the number of printed lines that will fit on one page of output.
The ECHO setting tells SQL*Plus whether you want the contents of script files to be echoed to the screen as they are executed.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With