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: finding the length of a "number" field

Re: finding the length of a "number" field

From: John P. Higgins <jh33378_at_deere.com>
Date: Sat, 06 Mar 1999 22:39:10 -0600
Message-ID: <36E202EE.530E8BDF@deere.com>


Instead of data_length, you should look at data_precision and data_scale.

I think the data_length of 22 represents the maximum size of a variable length numeric column. Note that ALL numeric columns are variable length in Oracle.

jerwynn_at_my-dejanews.com wrote:

> Hi,
>
> I have created a table using the ff:
>
> create table employee
> ( id number(7) PRIMARY KEY,
> name varchar2(30),
> salary number(8,2)
> )
>
> When I use SQL Plus: describe employee,
> the correct column definition is returned.
>
> However, if I query from the user_tab_columns (or col) table/view,
> the data_length of the number fields is incorrect.
>
> the data_length for columns with data type "number" is always 22.
> thus number(8,2) becomes number(22)
> and number(7) becomes number(22).
>
> If you know how to query the length of a field, please email or reply to this
> newsgroup
>
> Thanks.
>
> Jerwynn
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Sat Mar 06 1999 - 22:39:10 CST

Original text of this message

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