Oracle OleDB and high precision NUMBER fields --> DBTYPE_VARNUMERI

G

Guest

I have problems readings rows via OleDBDataReader or OleDBDataAdapter when a
NUMBER column in Oracle has a precision greater than 28 digits.
If I save e.g. 1E30 in a NUMBER column (via TOAD or SQL+ ...) and try to
read the correspondending row via OLeDB I get a
System.Data.OleDb.OleDbException: Accessor is not a parameter accessor
Very bad behaviour is, that I can't read out other columns of such a row
even if those columns have normal types (like varchar...).

This behaviour can be reproduced with OraOLEDB and the MSDAORA dataprovider.

I see via OleDBDatReader.GetDataTypeName(int ord) that those Oracle NUMERIC
column will be mapped to DBTYPE_VARNUMERIC. But it seems, that no mapping is
possible (definied) to a CLR data type.

In short: If a NUMERIC column contains 1000 or 3.14152 everything works
fine. If content is 1e30 or
1.111111111111111111111111111111111111111111111e-100 reading fails with an
exception.

I had contacted the Oracle support. They told me:
"Here is the answer from development team regarding your issue.
..NET decimal data type does not support precision more than 28 and hence the
issue with OraOLEDB as well as MSDAORA. In fact, you would see the same
issue with SQLOLEDB and SQL Server. It is more of a .NET limitation rather
then a provider one."

Is there a common how to solve this problem? It least it should be possible
to map high precision table content to a double by default- even if there is
a loss in precision.

Thanks for every comment,
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top