Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with USER_TAB_COLUMNS DATA_LENGTH

Re: Problem with USER_TAB_COLUMNS DATA_LENGTH

From: Jurij Modic <jmodic_at_src.si>
Date: Fri, 18 Jun 1999 22:30:23 GMT
Message-ID: <3771c870.11964578@news.arnes.si>


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)



The above opinions are mine and do not represent any official standpoints of my employer Received on Fri Jun 18 1999 - 17:30:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US