Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem for column defined as number(xx) returns as nnnnn.0 from an sql statement

Re: Problem for column defined as number(xx) returns as nnnnn.0 from an sql statement

From: Frank van Bortel <fbortel_at_home.nl>
Date: Fri, 10 Nov 2000 20:11:52 GMT
Message-ID: <3A0C2201.E627584@home.nl>

Connected to:
Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production With the Partitioning option
JServer Release 8.1.6.0.0 - Production

SQL> create table blah(x number (11));
Table created.

SQL> insert into blah values(99);
SQL> insert into blah values(88.0);
SQL> insert into blah values(76.0);
SQL> insert into blah values(74);

SQL> select * from blah;

         X


        99
        88
        76
        74

== So, it is not the way you input your data: 88.0 is displayed as 88.

SQL> col x for 99999999.0
SQL> /           X


       99.0
       88.0
       76.0
       74.0

== Ah! This is what you get, too!

SQL> clear columns
columns cleared
SQL> /          X


        99
        88
        76
        74

== Your column must have the same name as a column (or alias) that has a format mask attached to it - clear format masks with the clear columns command, as above.

qdn wrote:

> We defined a table with several columns as number(11)
>
> Upon executing a sql like: select * from mytable, we get xxxx.0
> instead of what we expect: xxxx
>
> The confusing part was that this only occurs SOMETIMES, most other
> times, we get xxxx
>
> Is there a configuration file somewhere with Oracle where we can set
> the default format so that it would return the number without the
> decimal digit?
>
> We rather not have to drop all the tables and redo them as
> number(11,0).
>
> Any help would be greatly appreciated.
>
> PS: Version 8.1.5? with WebLogic
>
> quocducnguyen_at_yahoo.com

--
Gtrz,

Frank van Bortel
Received on Fri Nov 10 2000 - 14:11:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US