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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle and Floating Points

Re: Oracle and Floating Points

From: Michael Dixon <dixon_at_cs.fsu.edu>
Date: 1997/12/05
Message-ID: <6693c9$f3d$1@news.fsu.edu>#1/1

Thomas Kyte (tkyte_at_us.oracle.com) wrote:
: All oracle numbers are stored internally as a varying length string in the
: database (upto 22 bytes in length, giving 38 digits of precision). The problem
: in this case is not in the database but rather the front end.
:
: Do you, in delphi, have any control over the datatype delphi is using to hold
: the numbers before it sends them? It is delphi that is sending
: 123456789011.999. They must be putting the number into a C float on the client
: and sending that over. Can you somehow talk delphi into either using a STRING
: in the client application or using an int?
:

I'm using Delphi's built-in table component (which is supposed to work independently of the underlying database, as long as the proper drivers, etc. are in place). The imprecision actually comes in after I've passed the number to the table component (so I can't use trunc or round, as a previous poster suggested). Delphi also automatically translates the Oracle NUMBER type to its TFloatField type (I can't change that); no matter what type I try to give it, it will convert it to a float. I am digging through the source code for the component library to see if I can modify the table component.

Interesting note: I've found that this problem only occurs when using the native Oracle drivers; it doesn't happen using ODBC, but the current ODBC driver we have doesn't support the Level 2 calls. However, the client is running an "unsupported" Oracle configuration (Server 7.2, SQL*Net 2.3), so Oracle can't guarantee that any version of the ODBC driver will work. I'm currently trying to find the SQL*Net 2.2 disks to see if that configuration will work, as well as trying to figure out what's going on with the native drivers (since the client needs the speed).

: Many, many applications use NUMBER as the primary key (its not unfortunate, its
: very common).
:

Hmm. I would've thought NUMBER(n, 0) would be a better choice. But then, I'm still pretty new to Oracle.

Thanks,
  Michael Dixon
  dixon_at_tlh.fdt.net Received on Fri Dec 05 1997 - 00:00:00 CST

Original text of this message

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