Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Difference between Integer and Number- Correction
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