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: FLOAT Data Types under 8i?

Re: FLOAT Data Types under 8i?

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Mon, 20 Jan 2003 08:26:14 -0800
Message-ID: <3E2C2325.80F12285@exesolutions.com>


"Howard J. Rogers" wrote:

> Oracle has only one number datatype: NUMBER.
>
> Declared merely as NUMBER, it can store numbers up to 38 digits in length,
> with a decimal point anywhere within that. It is an inherently
> variable-length data type, however, so if you then stored the entry
> '100.35', it would only take up the space of those supplied 6 characters,
> not the space of the 38 possible.
>
> Or you could declare it as a number(6,2), meaning that there are 6 digits in
> total, two of which are after the decimal point (which covers your case of
> 1000.00), though again the thing is variable, and the actual number can be
> UP to 6 digits in total, but if you only supply 3 (ie, 3.55) that's what
> will be stored.
>
> Regards
> HJR
>
> "Rhugga" <root_at_syrrx.com> wrote in message
> news:3E2D80EA.3090106_at_syrrx.com...
> >
> > Are there no float datatypes in Oracle 8i? If not, what is the best var
> > for storing floating point number that will never be greater than say
> > 1000 with a 2 decimel point precision?
> >
> >
> > Thanks,
> > CC
> >
> >
> >
> > -----------== Posted via Newsfeed.Com - Uncensored Usenet News
> ==----------
> > http://www.newsfeed.com The #1 Newsgroup Service in the World!
> > -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers
> =-----

That being said one can define a table in 8i or 9i with a FLOAT data type.

http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a85397/sql_elem.htm#45865

FLOAT specifies a floating-point number with decimal precision 38, or binary precision 126.

FLOAT(b) specifies a floating-point number with binary precision b. The precision b can range from 1 to 126. To convert from binary to decimal precision, multiply b by 0.30103. To convert from decimal to binary precision, multiply the decimal precision by 3.32193. The maximum of 126 digits of binary precision is roughly equivalent to 38 digits of decimal precision.

Daniel Morgan Received on Mon Jan 20 2003 - 10:26:14 CST

Original text of this message

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