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 vs INTEGER datatype

RE: NUMBER vs INTEGER datatype

From: MacGregor, Ian A. <ian_at_SLAC.Stanford.EDU>
Date: Tue, 23 Jan 2001 10:46:29 -0800
Message-Id: <10750.127312@fatcity.com>


As Others have alluded, the integer datatype in Oracle is defined in terms of the number datatype. An integer is number with precision but without scale. The datatype integer allows the storage of the largest integer Oracle can handle. For primary keys or other columns which will hold only integer values, I define the columns by explicitly stating the precisions and scales; e.g., person_id number(7,0).

Ian MacGregor
Stanford Linear Accelerator Center
ian_at_slac.stanford.edu

-----Original Message-----
From: Helmut Daiminger [mailto:hdaiminger_at_vivonet.com] Sent: Monday, January 22, 2001 11:05 AM
To: Oracle DBA List (Lazy DBA) (E-mail); Oracle List (Telelist) (E-mail) Subject: NUMBER vs INTEGER datatype

Hi!

I have a question concerning datatypes in Oracle. What do you think about this? Would it be a good idea to use INTEGER instead of NUMBER datatype for PK columns generated by sequences? There's always only gonna be 'regular' numbers in that column (e.g. 1, 2, 3, 4, ..., 1457, 1458 etc.)

What is the advantage/disadvantage of using one over the other?

This is the request from one of our lead developers:

> For some reason, unknown to me, we have always used the
> datatype NUMBER to represent Integers in the database.
> I do not understand why we do not use INTEGER type when we
> need an Integer,
> and I would request that in the future, we use type INTEGER
> unless there is a reason for not doing so.
> I ran into a problem reverse-engineering the DB in Rational
> Rose, because it
> turned the NUMBER fields into FLOAT type in the model. I
> reported this as a
> bug to Rational, and thir response is included below:

Any idea?

This is 8.1.6 on Win2k.

Thanks,
Helmut



Think you know someone who can answer the above question? Forward it to them! to unsubscribe, send a blank email to oracledba-unsubscribe_at_LAZYDBA.com to subscribe send a blank email to oracledba-subscribe_at_LAZYDBA.com Visit the list archive: http://www.LAZYDBA.com/odbareadmail.pl Received on Tue Jan 23 2001 - 12:46:29 CST

Original text of this message

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