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

Home -> Community -> Usenet -> c.d.o.server -> Re: Difference between Integer and Number- Correction

Re: Difference between Integer and Number- Correction

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 17 Oct 2002 23:14:08 GMT
Message-ID: <3DAF4436.1918918F@exesolutions.com>


kenneth.koenraadt_at_no-spam.hotmail.com wrote:

> I have a correction, as I blindly copied the Oracle DOC :
>
> The Ora 9i doc (under SQL reference -> "ANSI, DB2, and SQL/DS
> Datatypes") states that an INTEGER is stored internally as a
> NUMBER(38).
>
> However, the following ;
>
> create table foo (c1 number(38), c2 integer);
> -- inserting 60 decimal integers
> insert into foo values
> (111111111111111111111111111111111111111111111111111111111111,
> 111111111111111111111111111111111111111111111111111111111111);
>
> Gives :
> ORA-01438 value larger than specified precision allows for this
> column.
> But :
>
> insert into foo values (111111111111111111111111111111111,
> 111111111111111111111111111111111111111111111111111111111111);
>
> goes fine.
>
> And
>
> select column_name,data_type,data_precision,data_scale from
> dba_tab_columns
> where table_name ='FOO';
> -----------------------------------------------
> COLUMN_NAME DATA_TYPE DATA_PRECISION DATA_SCALE
> C1 NUMBER 38 0
> C2 NUMBER 0
>
> Confirms the that INTEGER is *not* equal to NUMBER(38).
>
> Instead :
>
> create table foo (c1 number(*,0), c2 integer);
>
> select column_name,data_type,data_precision,data_scale from
> dba_tab_columns
> where table_name ='FOO';
> -----------------------------------------------
> COLUMN_NAME DATA_TYPE DATA_PRECISION DATA_SCALE
> C1 NUMBER 0
> C2 NUMBER 0
>
> Conclusion :
>
> INTEGER is stored internally as a NUMBER(0,*) in Oracle 8i and 9i.
>
> Comments welcome !
>
> - Kenneth Koenraadt

I'm not sure that I can agree that you have demonstrated what you claim to have demonstrated.

Daniel Morgan Received on Thu Oct 17 2002 - 18:14:08 CDT

Original text of this message

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