Re: Oracle 10g Float and Double Database Datatypes are not support



I couldn't agree more about the size of the Oracle Client. I'm looking into
the 'DOUBLE PRECISION' synonym now to see if I can use it to solve my problem
in a creative way. It looks like I can't directly have a table column type
be 'DOUBLE PRECISION', but there may be an alternate solution here... I use
both MS and ODP.NET Providers because they both offer distinct advantages...
I was really hoping for the types to resolve as they do in this article:

http://support.microsoft.com/kb/104977/en-us?spid=2509&sid=234

Only, precision >=15 is a Decimal.

Thanks for the feedback,
-Valkyrie-MT

"Frans Bouma [C# MVP]" wrote:

Valkyrie-MT wrote:

Frans,

I understood what you said perfectly. My problem is that the two
statements are a bit contradictory. DOUBLE PRECISION should result
in a Double, but in the primary numeric datatype in Oracle, NUMBER,
with double precision is a Decimal.

I know, but oracle has/had a synonym type called 'DOUBLE PRECISION'
which should resolve to a double. At least, in my mapping tables it
does for the MS provider. (I've to rerun the tests I did to re-check if
that's still the case though)

I'm just trying to express my frustration with what I think is a
design issue here by MS.

Well, I fully agree with you that this is very frustrating. In our O/R
mapper we support both, ODP.NET and MS' oracle provider, and every week
a couple of people wonder why the MS' provider returns Decimals for
NUMBER fields and ODP.NET doesn't. The sad thing is that ODP.NET is so
massive that installing it on a lot of desktops is sometimes a tough
call for people so they really want to use the MS provider but then of
course run into this silly issue.

I get beat over the head with this sort of
issue by developers using Eclipse and Java 1.5 all the time. I think
VS2005/C# is better, but when there is a problem like this I have no
recourse because VS2005 is not open source... Then I have others
tell me that it's not in MS's best interests to fix it. Well, that's
just unfortunate. Since VS2005 is not open source, the burden is on
MS to make sure these issues are addressed and resolved in a timely
manner.

Well, did you try ODP.NET 10.2 ? It should fix your problem ;)

FB


Oh well,
-Valkyrie-MT


"Frans Bouma [C# MVP]" wrote:

Valkyrie-MT wrote:

Frans,

You stated that "DOUBLE PRECISION should result in a Double."
But an Oracle column of type NUMBER(5) has less precision than a
Double, but is always interpreted as a Decimal.

You should have read what I also said: the MS Oracle provider
converts ALL NUMBER(x,y) types into decimals, no matter what x, y
is. :)

Ultimately, in my opinion, this is a combination of two problems
with implementation by MS. First, the NUMBER type should be
mapped to system types that are the closest possible match
without overflow. Second, when a SQL statement in a TableAdapter
is modified, new columns should not be added if columns with the
same name already exist. There are many properties that can
configured on the DataTable and if you add replacement columns
just because some of the properties were tweaked, this makes
making any changes to DataColumn properties almost worthless.

It's of course not in MS' interest to provide a rocksolid oracle
provider. It 'works' but you can better use ODP.NET

I could use ODP.NET, but it does not support TableAdapters.

I believe the 10.2 one does (with the vs.net tools)

FB


Thanks,
-Valkyrie-MT

"Frans Bouma [C# MVP]" wrote:

Valkyrie-MT wrote:

Greetings,

I have data values that are inherently of type Double.
Current we are using Oracle Column Datatype NUMBER. When I
create a TableAdapter in VS2005, the database table column
information is read from Oracle and a new Table is created.
However, the detected datatypes are always Decimal. Even if
I change the datatype in the Database to a lower precision
that would not exceed the precision of a Double, it is always
detected as a Decimal. This forces me to cast everywhere,
making the strongly-typed dataset, not as useful.

The MS Oracle provider always uses decimal for NUMBER(x,y)
types, despite the values of x and y. The provider of Oracle,
ODP.NET does a better job though. If you need these types,
please consider using ODP.NET. It also offers support for
XmlType, something which isn't supported by the MS oracle
provider.

Question: Is there ANY numeric datatype I can use in Oracle
that will be detected by the the MS Oracle Data Provider as a
System.Double in the Strongly-Typed representation?

DOUBLE PRECISION should result in a Double.


--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------

.



Relevant Pages