Home » SQL & PL/SQL » SQL & PL/SQL » how to store the 15 digit decimal value ? (merged 4)
how to store the 15 digit decimal value ? (merged 4) [message #385988] Thu, 12 February 2009 02:59 Go to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
SQL> create table test_number( id int,no numeric(28,15));

Table created

SQL> insert into test_number values(1,12.676767676767679);

1 row inserted

SQL> select * from test_number;

                                     ID                             NO
--------------------------------------- ------------------------------
                                      1             12.676767676767700

SQL> insert into test_number values(1,12.676767676767571);

1 row inserted

SQL> select * from test_number;

                                     ID                             NO
--------------------------------------- ------------------------------
                                      1             12.676767676767700
                                      1             12.676767676767600


it is showing rounding off the numeric value after 12 digits . how to get for 15 digit decmal exact value


Thanks
Rangan S
Re: How to get 15 digit decimal value ? [message #385995 is a reply to message #385988] Thu, 12 February 2009 03:14 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member

SQL>  col no format 99.999999999999999
SQL> select * from test_number;

        ID                  NO
---------- -------------------
         1  12.676767676767679
Re: How to get 15 digit decimal value ? [message #385999 is a reply to message #385995] Thu, 12 February 2009 03:24 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member
one more thing...Dont MultiPost your message.After Submit check whether the message is there or not ...
Re: How to get 15 digit decimal value ? [message #386002 is a reply to message #385995] Thu, 12 February 2009 03:37 Go to previous messageGo to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
SQL> DROP TABLE TEST_NUMBER;

Table dropped

SQL> create table test_number( id int,no numeric(28,15));

Table created

SQL> insert into test_number values(1,12.676767676767679);

1 row inserted

SQL> select * from test_number;

                                     ID                             NO
--------------------------------------- ------------------------------
                                      1             12.676767676767700

SQL> col no format 99.999999999999999
SQL> /

                                     ID                             NO
--------------------------------------- ------------------------------
                                      1             12.676767676767700

SQL> select column_name, data_type, data_precision, data_scale from dba_tab_columns where table_name = 'TEST_NUMBER';

COLUMN_NAME                    DATA_TYPE                                                                        DATA_PRECISION DATA_SCALE
------------------------------ -------------------------------------------------------------------------------- -------------- ----------
ID                             NUMBER                                                                                                   0
NO                             NUMBER                                                                                       28         15
Re: How to get 15 digit decimal value ? [message #386008 is a reply to message #386002] Thu, 12 February 2009 03:54 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> create table test_number( id int,no numeric(28,15));

Table created.

SQL> insert into test_number values(1,12.676767676767679);

1 row created.

SQL> col no format 99.999999999999999
SQL> select * from test_number;
        ID                  NO
---------- -------------------
         1  12.676767676767679

1 row selected.

You MUST always post full version number for both client and server side.
And keep your lines in 80 characters width.

Regards
Michel

[Updated on: Thu, 12 February 2009 03:55]

Report message to a moderator

Re: how to store the 15 digit decimal value ? (merged 4) [message #386009 is a reply to message #385988] Thu, 12 February 2009 03:55 Go to previous messageGo to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
SQL> select * from v$VERSION;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production

TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Re: how to store the 15 digit decimal value ? (merged 4) [message #386010 is a reply to message #386009] Thu, 12 February 2009 03:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And the client? (SQL*Plus)
 def _SQLPLUS_RELEASE 

Regards
Michel
Re: how to store the 15 digit decimal value ? (merged 4) [message #386017 is a reply to message #386010] Thu, 12 February 2009 04:25 Go to previous messageGo to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
SQL> def _SQLPLUS_RELEASE;
DEFINE _SQLPLUS_RELEASE = "000000000" (CHAR)
Re: how to store the 15 digit decimal value ? (merged 4) [message #386031 is a reply to message #386017] Thu, 12 February 2009 04:50 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So get it in other way, like in its banner when you start it.

Regards
Michel
Re: how to store the 15 digit decimal value ? (merged 4) [message #386034 is a reply to message #385988] Thu, 12 February 2009 05:07 Go to previous message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
What's the result of

SELECT TO_CHAR(no)
FROM test_number


Maybe the environment/registry setting of NLS_NUMBER_FORMAT?

[Updated on: Thu, 12 February 2009 05:11]

Report message to a moderator

Previous Topic: Help me Please
Next Topic: how to write this query using correlation subquery or non exists clause
Goto Forum:
  


Current Time: Fri Dec 09 03:51:57 CST 2016

Total time taken to generate the page: 0.08129 seconds