Sequence.nextval numeric type in Oracle 10g differs from Oracle 8i when using MS OleDb provider

  • Thread starter Thread starter alasdair.johnson
  • Start date Start date
A

alasdair.johnson

A bug I noticed which doesn't seem to be posted on usenet, nor
recognized by Oracle (who didn't want to help unless we had been using
their ADO.NET provider...):

We used to retrieve the sequence id, mysequence.nextval, into ADO.NET.
This was returned as a decimal and so we cast it directly to a
decimal. However, when we upgraded the Oracle database to 10g, the
code broke because the value thus returned was then a double
(which .NET can't seem to cast to a decimal - go figure). We were
using Microsoft's generic OleDb provider to access the Oracle
databases (Provider=MSDAORA.1).

The fix, it turns out, is to use the Oracle OleDb provider (Provider =
OraOLEDB.Oracle). This provides a drop-in replacement for the
Microsoft OleDb provider, and thus obviates the need for making
changes to the code (which for us would have been a pain). Hopefully
there are no significant differences otherwise between the two
providers...

I hope this helps someone else who may also come across this problem.
 
Back
Top