There is no default column size for column of type NUMBER, i.e. no space is reserved in database for nonexisting values (NULLs) of type NUMBER.
When you store some values in such column, the physical space used by those values depends on the actual values stored. It can vary anywhere from 1 byte to 21 bytes.
You can check the size used by values stored in your table by isuing:
SELECT col1, VSIZE(col1) bytes_used FROM my_table;
You can find out how much space your number will use if stored in the table by isuing the following (example for number -123.4567):
While doing table sizing, if the table designer does not give any length and just gives Col1 NUMBER, how much bytes should I take while doing new table sizing.
Thanks,
Sam
------------------------
To handle yourself, use your head. To handle others, use your heart
From the docs: Oracle stores numeric data in variable-length format. Each value is stored in scientific notation, with one byte used to store the exponent and up to 20 bytes to store the mantissa. The resulting value is limited to 38 digits of precision. Oracle does not store leading and trailing zeros. For example, the number 412 is stored in a format similar to 4.12 x 102, with one byte used to store the exponent (2) and two bytes used to store the three significant digits of the mantissa (4, 1, 2). Negative numbers include the sign in their length.
Taking this into account, the column size in bytes for a particular numeric data value NUMBER (p), where p is the precision of a given value, can be calculated using the following formula:
ROUND((length(p)+s)/2))+1
where s equals zero if the number is positive and s equals 1 if the number is negative.
Zero and positive and negative infinity (only generated on import from Version 5 Oracle databases) are stored using unique representations. Zero and negative infinity each require one byte; positive infinity requires two bytes
I am still not clear if anything is reserved for NULLS??
I am still not clear if anything is reserved for NULLS??
Nothing is reserved for NULL value if this column is the last one in a table or if all other trailing columns contain only NULL values. If any column following this NULL value contains any non-NULL value then 1 byte is reserved for this NULL value column.
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Bookmarks