Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Estimate row length and INT to NUMBER(38)
A copy of this was sent to "Maggie" <maggiezhou_at_hotmail.com> (if that email address didn't require changing) On Thu, 16 Mar 2000 14:18:01 -0800, you wrote:
>One of developer in my company generated Sequence number from 1 increment
>with 1 and define sequence as INT. However, Oracle convert INT to
>NUMBER(38). I try to estimate the table size. I dont know how to
>calculate the row length becasue number is variable-length data type and the
>sequence generated only occupy serveral digits but it show as NUMBER(38).
>This developer defined many columns as INT and finally he got many
>NUMBER(38) length columns. Do I need ask him to change his table
>definition?
>
>
>
All numbers are always stored as variable length fields -- there is no such thing as a "4 byte number" in Oracle. All of them are variable length.
The int column is simply an "edit" that says -- store any integer with upto 38 digits of precision. It may consume between 0 and 22 bytes of space.
The only thing you could do is ask them to use number(N) with N is the max number of digits they would ever want. That'll put a lower upper bound on the number of digits they could store.
-- http://osi.oracle.com/~tkyte/ Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA Opinions are mine and do not necessarily reflect those of Oracle CorporationReceived on Fri Mar 17 2000 - 00:00:00 CST