Monday, July 21, 2008

Display Large Precision Numbers in SQL*Plus

For example, when creating a table like:
SQL> create table t1 (id number(17,3));


Then inserting a value like:
SQL> insert into t1 values(99999999999999.999);
Selecting from the table shows:
SQL> select * from t1;

ID
----------
1,0000E+14
A NUMBER column's width equals the width of the heading or the width of the FORMAT plus one space for the sign, whichever is greater. If you do not explicitly use FORMAT, then the column's width will always be at least the value of SET NUMWIDTH. What we have to do,
SQL> set NUMWIDTH 18
SQL> select * from t1;

ID
------------------
99999999999999.999
OR,
SQL> column id format 99999999999999999.999
SQL> select * from t1;

ID
----------------------
99999999999999.999

No comments:

search engine

Custom Search