Tim Bunce wrote:
>
> Thanks for the info. Do you have any strong objections to DBD::Oracle
> replicating the Oracle ODBC results?
>
Yes, in general, because we wasted a lot of time with ODBC driver
peculiarities. We are already very happy with the DBI portability!
So we hope, DBI does *not* try to be bug compatible with the ODBC
drivers -:)
Yes, regarding binary vs. decimal precision:
- The Oracle data dictionary contains binary precision for
FLOAT's and decimal precision for NUMBER's.
- OCI (and so DBD::Oracle) returns binary precision for FLOAT's
and decimal precision for NUMBER's.
- The SQL Standard (see below) specifies binary precision for
approximate numeric types and decimal precision for exact
numeric types.
We can accept decimal precision for both types. But it would be
nice, if all DBI driver (except DBD::ODBC) support the same rules.
At least, they should document different behavior.
Also, setting the scale for approximate numeric types to 'undef'
instead of '0' would be clearer, because this property is not
applicable for these types.
Steffen and Olga
----------------------------------
ISO-ANSI Working Draft: Foundation
SQL/Foundation
WG3:YGJ-011 X3H2-99-079
March, 1999
6.1 <data type>
20) The <scale> of an <exact numeric type> shall not be greater
than the <precision> of the <exact numeric type>.
21) For the <exact numeric type>s DECIMAL and NUMERIC:
a) The maximum value of <precision> is implementation-defined.
<precision> shall not be greater than this value.
b) The maximum value of <scale> is implementation-defined.
<scale> shall not be greater than this maximum value.
22) NUMERIC specifies the data type exact numeric, with the
decimal precision and scale specified by the <precision>
and <scale>.
23) DECIMAL specifies the data type exact numeric, with the decimal
scale specified by the <scale> and the implementation-defined
decimal precision equal to or greater than the value of the
specified <precision>.
...
26) FLOAT specifies the data type approximate numeric, with binary
precision equal to or greater than the value of the specified
<precision>. The maximum value of <precision> is implementation-
defined. <precision> shall not be greater than this value.
27) REAL specifies the data type approximate numeric, with
implementation-defined precision.
28) DOUBLE PRECISION specifies the data type approximate numeric,
with implementation-defined precision that is greater than the
implementation-defined precision of REAL.
29) For the <approximate numeric type>s FLOAT, REAL, and DOUBLE
PRECISION, the maximum and minimum values of the exponent are
implementation-defined.