Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Naheed.

Asked: October 06, 2006 - 4:11 pm UTC

Last updated: October 06, 2006 - 4:37 pm UTC

Version: 9.1.1

Viewed 1000+ times

You Asked

Hi Tome

My question is what is the difference b/w number and integer in oracle. id there any difference in storage or performance if u declare a data type number and wat in case of integer.

and Tom said...

ops$tkyte%ORA10GR2> create table t ( x int );

Table created.

ops$tkyte%ORA10GR2> desc t;
Name Null? Type
---------------------------------------- -------- ----------------------------
X NUMBER(38)


"int" is an alias for Number(38) - upto 38 digits of precision (no scale, no decimals). Not a bit of difference in the storage at all.


b/w?
u?

you should really consider using real words for, well, words. It makes it needlessly hard to read.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

what about float ?

A reader, October 06, 2006 - 4:31 pm UTC

float doesn't seem to be an alias

SQL> create table t ( x float);

Table created.

SQL> desc t
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 X                                                  FLOAT(126)


so when should I use float ? 

Tom Kyte
October 06, 2006 - 4:37 pm UTC

you did not question me about float, so - why would I comment on that?

but rest easy, the float is also just an alias, it is really a number under the covers.

</code> http://docs.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#SQLRF00213 <code>

Not unless and until you start using the BINARY_.... floats/doubles would the story change at all.