Decimal Conversion failed Oracle dataset

G

Guest

Using System.Data.OleDb
Dim ds As New DataSet
da.Fill(ds)

When I run this against Oracle 9.1 I get:
"Conversion failed because the Decimal data value overflowed the type
specified for the Decimal value part in the consumer's buffer."

Sounds like OleDB doesn't know how to handle big numbers/decimals in Oracle?
 
K

Kevin Yu [MSFT]

Hi,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're trying to fill a DataSet
from Oracle server, an overflow exception was thrown. If there is any
misunderstanding, please feel free to let me know.

As far as I know, something might go wrong when a large decimal value is
filled to a DataSet from Oracle. In .NET framework, the Oracle NUMBER type
is mapped to Decimal. Oracle NUMBER type is number, whose maximum value can
be up to 38 digits. However, .NET frameworks System.Decimal struct raises
to an exponent ranging from 0 to 28. So, when filling the DataSet, the
Decimal field might overflow.

Please check if there is any big NUMBER values. If so, I think this is by
design.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
G

Guest

There are big numbers (e.g. 1/3 E99).
Any work arounds?
Any way to have the provider map decimals to doubles?
 
K

Kevin Yu [MSFT]

Hi,

As far as I know, we can only use OracleDataReader.GetOracleNumber method
to put data to an OracleNumber structure. Or create a column whose data
type is OracleNumber and map all the data to that column. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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