VW ODBC translates Oracle NUMERIC to FixedPoint

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

VW ODBC translates Oracle NUMERIC to FixedPoint

Terry Raymond
Hi

I am working on incorporating the ODBC interface into our
application. While investigating it, I found that its treatment
of Oracle NUMERIC type is inconsistent with results of using
the Oracle interface. It seems that the Oracle interface
translates NUMERIC data to smalltalk Integers while the ODBC
interface translates the data to smalltalk FixedPoints.

Has anyone else observed this or has a fix for it?

I also noticed that the ODBC interface obtains the NUMERIC
data as a string and then translates it to FixedPoint. This
seems to be a bit inefficient.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

Reply | Threaded
Open this post in threaded view
|

RE: VW ODBC translates Oracle NUMERIC to FixedPoint

Boris Popov, DeepCove Labs (SNN)
Yea, the latter one about to/from string has been bugging me for a while
as well. It's been discussed here previously and the consensus was that
while it would be nice to implement it using proper data structures it
wouldn't happen for a while.

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: Terry Raymond [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 11:15 AM
> To: VWNC
> Subject: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> Hi
>
> I am working on incorporating the ODBC interface into our
> application. While investigating it, I found that its treatment
> of Oracle NUMERIC type is inconsistent with results of using
> the Oracle interface. It seems that the Oracle interface
> translates NUMERIC data to smalltalk Integers while the ODBC
> interface translates the data to smalltalk FixedPoints.
>
> Has anyone else observed this or has a fix for it?
>
> I also noticed that the ODBC interface obtains the NUMERIC
> data as a string and then translates it to FixedPoint. This
> seems to be a bit inefficient.
>
> Terry
>
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================

Reply | Threaded
Open this post in threaded view
|

RE: VW ODBC translates Oracle NUMERIC to FixedPoint

Wallen, David
In reply to this post by Terry Raymond
I'll foolishly stick my neck out before looking at the actual code.

> the Oracle interface. It seems that the Oracle interface
> translates NUMERIC data to smalltalk Integers while the ODBC
> interface translates the data to smalltalk FixedPoints.

I think NUMERIC data is actually fixed point data, so it sounds like
ODBC is doing the right thing. However, it is possible that the actual
column in question is defined with zero places after the decimal point.
In that case, the data is equivalent to an integer. But this might be
considered as a very special case.

> I also noticed that the ODBC interface obtains the NUMERIC
> data as a string and then translates it to FixedPoint. This
> seems to be a bit inefficient.

I'm not sure how else it can be done without losing precision, unless
the column really holds integers. But again, that's a worst case
scenario.

- Dave W

-----Original Message-----
From: Terry Raymond [mailto:[hidden email]]
Sent: Wednesday, November 14, 2007 11:15 AM
To: VWNC
Subject: VW ODBC translates Oracle NUMERIC to FixedPoint

Hi

I am working on incorporating the ODBC interface into our
application. While investigating it, I found that its treatment
of Oracle NUMERIC type is inconsistent with results of using
the Oracle interface. It seems that the Oracle interface
translates NUMERIC data to smalltalk Integers while the ODBC
interface translates the data to smalltalk FixedPoints.

Has anyone else observed this or has a fix for it?

I also noticed that the ODBC interface obtains the NUMERIC
data as a string and then translates it to FixedPoint. This
seems to be a bit inefficient.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

Reply | Threaded
Open this post in threaded view
|

RE: VW ODBC translates Oracle NUMERIC to FixedPoint

Terry Raymond
Dave

Well one problem is the way FixedPoint operates in VW vs
Integer. It prints differently and will be slower if it is
an integer.

IMHO, I think if the number is an integer value then
it should be represented by a smalltalk integer.

In our application we care about speed and accuracy.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: Wallen, David [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 6:00 PM
> To: Raymond, Terry; VWNC
> Subject: RE: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> I'll foolishly stick my neck out before looking at the actual code.
>
> > the Oracle interface. It seems that the Oracle interface
> > translates NUMERIC data to smalltalk Integers while the ODBC
> > interface translates the data to smalltalk FixedPoints.
>
> I think NUMERIC data is actually fixed point data, so it sounds like
> ODBC is doing the right thing. However, it is possible that the actual
> column in question is defined with zero places after the decimal point.
> In that case, the data is equivalent to an integer. But this might be
> considered as a very special case.
>
> > I also noticed that the ODBC interface obtains the NUMERIC
> > data as a string and then translates it to FixedPoint. This
> > seems to be a bit inefficient.
>
> I'm not sure how else it can be done without losing precision, unless
> the column really holds integers. But again, that's a worst case
> scenario.
>
> - Dave W
>
> -----Original Message-----
> From: Terry Raymond [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 11:15 AM
> To: VWNC
> Subject: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> Hi
>
> I am working on incorporating the ODBC interface into our
> application. While investigating it, I found that its treatment
> of Oracle NUMERIC type is inconsistent with results of using
> the Oracle interface. It seems that the Oracle interface
> translates NUMERIC data to smalltalk Integers while the ODBC
> interface translates the data to smalltalk FixedPoints.
>
> Has anyone else observed this or has a fix for it?
>
> I also noticed that the ODBC interface obtains the NUMERIC
> data as a string and then translates it to FixedPoint. This
> seems to be a bit inefficient.
>
> Terry
>
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================

Reply | Threaded
Open this post in threaded view
|

RE: VW ODBC translates Oracle NUMERIC to FixedPoint

Terry Raymond
In reply to this post by Wallen, David
Dave

I guess I should have added, that if the scale is 0 then
it should be an integer. One other problem is that the
column scale is not used.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: Wallen, David [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 6:00 PM
> To: Raymond, Terry; VWNC
> Subject: RE: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> I'll foolishly stick my neck out before looking at the actual code.
>
> > the Oracle interface. It seems that the Oracle interface
> > translates NUMERIC data to smalltalk Integers while the ODBC
> > interface translates the data to smalltalk FixedPoints.
>
> I think NUMERIC data is actually fixed point data, so it sounds like
> ODBC is doing the right thing. However, it is possible that the actual
> column in question is defined with zero places after the decimal point.
> In that case, the data is equivalent to an integer. But this might be
> considered as a very special case.
>
> > I also noticed that the ODBC interface obtains the NUMERIC
> > data as a string and then translates it to FixedPoint. This
> > seems to be a bit inefficient.
>
> I'm not sure how else it can be done without losing precision, unless
> the column really holds integers. But again, that's a worst case
> scenario.
>
> - Dave W
>
> -----Original Message-----
> From: Terry Raymond [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 11:15 AM
> To: VWNC
> Subject: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> Hi
>
> I am working on incorporating the ODBC interface into our
> application. While investigating it, I found that its treatment
> of Oracle NUMERIC type is inconsistent with results of using
> the Oracle interface. It seems that the Oracle interface
> translates NUMERIC data to smalltalk Integers while the ODBC
> interface translates the data to smalltalk FixedPoints.
>
> Has anyone else observed this or has a fix for it?
>
> I also noticed that the ODBC interface obtains the NUMERIC
> data as a string and then translates it to FixedPoint. This
> seems to be a bit inefficient.
>
> Terry
>
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================

Reply | Threaded
Open this post in threaded view
|

RE: VW ODBC translates Oracle NUMERIC to FixedPoint

Wallen, David
Terry,

I had a brief look at our ODBC and Oracle code (in the ColumnDescription
subclasses). I think you're right. In ODBC, there is no search for the
ideal numeric C type, if any, to retrieve the number into.
 
But I think a really friendly ODBC driver might do the checking for the
client, since ODBC does appear to allow for native C types to be
reported. Perhaps this is what the original ODBC EXDI design expects.
Since this may be too idealistic, I've filed AR 53322
(ODBCColumnDescription ignores scale and precision in NUMERIC columns)
to see about improving this. In the meantime, you might consider trying
another ODBC driver (I used to hear that the Microsoft ODBC driver for
Oracle is better than the one provided by Oracle).

- Dave W

-----Original Message-----
From: Terry Raymond [mailto:[hidden email]]
Sent: Wednesday, November 14, 2007 3:24 PM
To: 'VWNC'
Subject: RE: VW ODBC translates Oracle NUMERIC to FixedPoint

Dave

I guess I should have added, that if the scale is 0 then
it should be an integer. One other problem is that the
column scale is not used.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: Wallen, David [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 6:00 PM
> To: Raymond, Terry; VWNC
> Subject: RE: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> I'll foolishly stick my neck out before looking at the actual code.
>
> > the Oracle interface. It seems that the Oracle interface
> > translates NUMERIC data to smalltalk Integers while the ODBC
> > interface translates the data to smalltalk FixedPoints.
>
> I think NUMERIC data is actually fixed point data, so it sounds like
> ODBC is doing the right thing. However, it is possible that the actual
> column in question is defined with zero places after the decimal
point.

> In that case, the data is equivalent to an integer. But this might be
> considered as a very special case.
>
> > I also noticed that the ODBC interface obtains the NUMERIC
> > data as a string and then translates it to FixedPoint. This
> > seems to be a bit inefficient.
>
> I'm not sure how else it can be done without losing precision, unless
> the column really holds integers. But again, that's a worst case
> scenario.
>
> - Dave W
>
> -----Original Message-----
> From: Terry Raymond [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 11:15 AM
> To: VWNC
> Subject: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> Hi
>
> I am working on incorporating the ODBC interface into our
> application. While investigating it, I found that its treatment
> of Oracle NUMERIC type is inconsistent with results of using
> the Oracle interface. It seems that the Oracle interface
> translates NUMERIC data to smalltalk Integers while the ODBC
> interface translates the data to smalltalk FixedPoints.
>
> Has anyone else observed this or has a fix for it?
>
> I also noticed that the ODBC interface obtains the NUMERIC
> data as a string and then translates it to FixedPoint. This
> seems to be a bit inefficient.
>
> Terry
>
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================

Reply | Threaded
Open this post in threaded view
|

RE: VW ODBC translates Oracle NUMERIC to FixedPoint

Terry Raymond
Dave

Today it occurred to me that the ODBC EXDI is really
written to ODBC 2.0 instead of the more recent 3.5 standard.

I think some of the 3.0 procedures can facilitate the use
of precision and scale.

However, for our application we really wanted the data as
strings so I ended up creating subclasses of ODBCBuffer so
they would not translated the values into smalltalk objects.
I concluded that by having the driver perform all the
translations to string that I avoid the issues with precision
and scale as well as not having to deal with the FixedPoint
and Double printStrings.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: Wallen, David [mailto:[hidden email]]
> Sent: Thursday, November 15, 2007 5:37 PM
> To: Raymond, Terry; VWNC
> Subject: RE: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> Terry,
>
> I had a brief look at our ODBC and Oracle code (in the ColumnDescription
> subclasses). I think you're right. In ODBC, there is no search for the
> ideal numeric C type, if any, to retrieve the number into.
>
> But I think a really friendly ODBC driver might do the checking for the
> client, since ODBC does appear to allow for native C types to be
> reported. Perhaps this is what the original ODBC EXDI design expects.
> Since this may be too idealistic, I've filed AR 53322
> (ODBCColumnDescription ignores scale and precision in NUMERIC columns)
> to see about improving this. In the meantime, you might consider trying
> another ODBC driver (I used to hear that the Microsoft ODBC driver for
> Oracle is better than the one provided by Oracle).
>
> - Dave W
>
> -----Original Message-----
> From: Terry Raymond [mailto:[hidden email]]
> Sent: Wednesday, November 14, 2007 3:24 PM
> To: 'VWNC'
> Subject: RE: VW ODBC translates Oracle NUMERIC to FixedPoint
>
> Dave
>
> I guess I should have added, that if the scale is 0 then
> it should be an integer. One other problem is that the
> column scale is not used.
>
> Terry
>
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================
>
> > -----Original Message-----
> > From: Wallen, David [mailto:[hidden email]]
> > Sent: Wednesday, November 14, 2007 6:00 PM
> > To: Raymond, Terry; VWNC
> > Subject: RE: VW ODBC translates Oracle NUMERIC to FixedPoint
> >
> > I'll foolishly stick my neck out before looking at the actual code.
> >
> > > the Oracle interface. It seems that the Oracle interface
> > > translates NUMERIC data to smalltalk Integers while the ODBC
> > > interface translates the data to smalltalk FixedPoints.
> >
> > I think NUMERIC data is actually fixed point data, so it sounds like
> > ODBC is doing the right thing. However, it is possible that the actual
> > column in question is defined with zero places after the decimal
> point.
> > In that case, the data is equivalent to an integer. But this might be
> > considered as a very special case.
> >
> > > I also noticed that the ODBC interface obtains the NUMERIC
> > > data as a string and then translates it to FixedPoint. This
> > > seems to be a bit inefficient.
> >
> > I'm not sure how else it can be done without losing precision, unless
> > the column really holds integers. But again, that's a worst case
> > scenario.
> >
> > - Dave W
> >
> > -----Original Message-----
> > From: Terry Raymond [mailto:[hidden email]]
> > Sent: Wednesday, November 14, 2007 11:15 AM
> > To: VWNC
> > Subject: VW ODBC translates Oracle NUMERIC to FixedPoint
> >
> > Hi
> >
> > I am working on incorporating the ODBC interface into our
> > application. While investigating it, I found that its treatment
> > of Oracle NUMERIC type is inconsistent with results of using
> > the Oracle interface. It seems that the Oracle interface
> > translates NUMERIC data to smalltalk Integers while the ODBC
> > interface translates the data to smalltalk FixedPoints.
> >
> > Has anyone else observed this or has a fix for it?
> >
> > I also noticed that the ODBC interface obtains the NUMERIC
> > data as a string and then translates it to FixedPoint. This
> > seems to be a bit inefficient.
> >
> > Terry
> >
> > ===========================================================
> > Terry Raymond
> > Crafted Smalltalk
> > 80 Lazywood Ln.
> > Tiverton, RI  02878
> > (401) 624-4517      [hidden email]
> > <http://www.craftedsmalltalk.com>
> > ===========================================================