Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with USER_TAB_COLUMNS DATA_LENGTH
On 18 Jun 1999 19:30:59 GMT, bikle_at_bikle.com wrote:
>Hi,
>
>Consider and run the script below:
>
>CREATE TABLE DROPME (N NUMBER (9,2));
>
>SELECT DATA_LENGTH FROM USER_TAB_COLUMNS
>WHERE TABLE_NAME='DROPME'
>AND COLUMN_NAME='N';
>
>
>You will see this:
>
>Table created.
>
>
>DATA_LENGTH
>-----------
> 22
DATA_LENGTH column stores the maximum length in bytes required to *store* values for a datatype of a given column, not the actual defined "length" of a column. For NUMBER it is always 22 bytes, regardless of the precision and scale (1 byte for exponent, 20 bytes for a mantissa and 1 byte for negative sign). For NUMBER datatype you should look at DATA_PRECISION and DATA_SCALE columns if you want to find the precision and scale defined for a column, as you've already found out.
>-Dan
>---------------------------------------------------------------------
>Daniel B. Bikle/Independent Oracle Consultant
>bikle_at_bikle.com | 650/941-6276 | P.O. BOX AG LOS ALTOS CA 94023
>http://www.bikle.com
HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)
![]() |
![]() |