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: <kenneth.koenraadt_at_no-spam.hotmail.com>
Date: Thu, 17 Oct 2002 20:09:56 GMT
Message-ID: <3daf1223.5167730@news.mobilixnet.dk>


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 !

Received on Thu Oct 17 2002 - 15:09:56 CDT

Original text of this message

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