Oracle NUMBER(p) storage size?

后端 未结 3 722
半阙折子戏
半阙折子戏 2021-02-05 07:57

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: N

3条回答
  •  生来不讨喜
    2021-02-05 08:13

    The number data type in Oracle is a special data type that is variable length like varchar. Then if you store the same data in number(5) and number(20) the storage is the same like declaring a column as varchar(100) and varchar(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.

提交回复
热议问题