Number columns display in Command Window

adryan

Member
Hi,

I am using version 7.1.5.1396 and I have observed the following situation in the Command Window:

create table t(c1 number);
insert into t values(12345678901);--eleven digits
select * from t;--Only 10 digits returned

I suspect the explanation is that the default value for the sqlplus variable numwidth is 10, and this behavior is cloned by the Command Window, but
sqlplus takes care to display number column values by using 10 character limited scientific format for numbers which have more than 10 digits (although 1.2346E+10 doesn't look very well when compared with 12345678901).

On the other hand, the SQL Window auto-sizes such column values and displays the complete number - a nice to have feature for the Command Window - which already accustomed us with a more user-friendly console :) .

Thanks,
Adryan
 
You can use the SET NUMWIDTH 11 command for this. The problem with number fields without precision is that the Command Window cannot predict how wide the column needs to be.
 
I was just hoping that the way the SQL Window predicts how wide the (number also) columns needs to be in it's displayed results grid could be (easily) transferred to the Command Window, to have auto-size also for the number columns :D .
Otherwise the user has to predict it for each number column (and even with SET commands in AfterConnect.sql the maximum length of all rows would be predicted, even if only a few would be selected, which would lead to longer lines displayed and a consistent and forever editing of the AfterConnect file :D ).

Thank you,
Adryan
 
Back
Top