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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: NUMBER datatype

RE: NUMBER datatype

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Wed, 07 Mar 2001 11:29:51 -0800
Message-ID: <F001.002C62C6.20010307104539@fatcity.com>

> -----Original Message-----
> From: paquette stephane [mailto:stephane_paquette_at_yahoo.com]
> Sent: mercredi, 7. mars 2001 00:31
> To: Multiple recipients of list ORACLE-L
> Subject: RE: NUMBER datatype
>
>
> Hi Steve,
>
> I posted that question a couple of days ago but got no
> answer. Do you agree that if I create a table with
> plain number fields instead of number (x,y) I can
> store any value with any precision as long as I do not
> reach Oracle limits ?

Do I understand your question correctly? Yes, a number field can contain any positive or negative number up to a certain precision.

I seem to lose precision after 40 digits.

SQL> create table t (row_num number (2), n number) ;

Table created.

SQL> -- 40-digit number
SQL> insert into t (row_num, n)
  2  values (1, 1234567890123456789012345678901234567890) ;

1 row created.

SQL> -- 41-digit number
SQL> insert into t (row_num, n)
  2  values (2, 12345678901234567890123456789012345678901) ;

1 row created.

SQL> select row_num,
  2  to_char (n, rpad ('9', 50, '9')) as big_num   3  from t ;

   ROW_NUM BIG_NUM

---------- ---------------------------------------------------
         1            1234567890123456789012345678901234567890          2           12345678901234567890123456789012345678900

SQL> select * from v$version ;

BANNER



Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production PL/SQL Release 8.1.6.0.0 - Production
CORE    8.1.6.0.0       Production
TNS for 32-bit Windows: Version 8.1.6.0.0 - Production NLSRTL Version 3.4.1.0.0 - Production

any ignorant comments made are the sole responsibility of J. R. Kilchoer and should not reflect adversely upon my employer.

 
Jacques R. Kilchoer
(949) 754-8816
Quest Software, Inc.
8001 Irvine Center Drive
Irvine, California 92618
U.S.A.
http://www.quest.com Received on Wed Mar 07 2001 - 13:29:51 CST

Original text of this message

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