I've searched for it but i can't find a conclusive answer to my question...
I need to know what is the storage size of a number(p) field in Oracle.
Examples: NUMBER(1), NUMBER(3), NUMBER(8), NUMBER(10) etc...
I've searched for it but i can't find a conclusive answer to my question...
I need to know what is the storage size of a number(p) field in Oracle.
Examples: NUMBER(1), NUMBER(3), NUMBER(8), NUMBER(10) etc...
The
number
data type in Oracle is a special data type that is variable length likevarchar
. Then if you store the same data innumber(5)
andnumber(20)
the storage is the same like declaring a column asvarchar(100)
andvarchar(200)
.So specifying the p parameter in
number(p,s)
has no effect on storage size and is only for applying constraint on the data. But specifying the s parameter can reduce the size by rounding the data.the minimum storage size of number data type is 1 byte and the maximum is 21 bytes. So if you do not want to apply constraint then use
number
data type without p parameter.Refer here and also may be here
The storage used depends on the actual numeric value, as well as the column precision and scale of the column.
The Oracle 11gR2 concepts guide says:
The 10gR2 guide goes further:
If you have access to My Oracle Support, there is more information in note 1031902.6.
You can see the actual storage used with
vsize
ordump
.Notice that the storage varies depending on the value, even though they are all in a
number(10)
column, and that two 3-digit numbers can need different amounts of storage.