Skip to Main Content
  • Questions
  • issue with exponent value with number column

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question.

Asked: April 12, 2019 - 6:17 am UTC

Last updated: April 15, 2019 - 5:11 am UTC

Version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

Viewed 1000+ times

You Asked

Hi ,

i am summing up the number column based other columns.
But while doing sum small value converted into exponent.
for exp.

to_comm Number(10);

0.0000474 converted into 4.74E-5.

I can change the setting of client to see small value but i need to pass the actual value(0.0000474) to java side.

please help how can i send value(0.0000474) as it is to java .


and Connor said...

The actual value *is* being passed to the Java side. The *display* of the number of entirely up to the client application. For example, using SQLPlus

SQL> create table t ( x number );

Table created.

SQL> insert into t values (0.0000474);

1 row created.

SQL> select * from t;

        X
---------
  4.7E-05

SQL> col x format 99.9999999999
SQL> select * from t;

             X
--------------
   .0000474000

SQL> col x format 99.99999
SQL> select * from t;

        X
---------
   .00005


Either your Java application is outputting the number in this format, OR you are passing a string from the database back to the Java (which is not a good idea).

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Design

New to good database design? Check out Chris Saxon's full fundamentals class.