Forum Stats

  • 3,770,581 Users
  • 2,253,136 Discussions
  • 7,875,499 Comments

Discussions

OLE DB Floating point conversion error

oxymorocycle
oxymorocycle Member Posts: 2
edited Aug 11, 2017 10:42AM in Oracle Provider for OLE DB

I have an application in Delphi 10.1 using ADO to connect to an Oracle Database though OLE DB. I am querying a table with a column which has a floating point NUMBER data type. For some values in the table I get an error.

The returned values are VARIANT types with type VT_DECIMAL (https://msdn.microsoft.com/en-us/library/windows/desktop/ms221061(v=vs.85).aspx ) but the scale value in the decimal structure is set to 29 which is outside the 0 to 28 range defined for this type so, when Delphi calls the windows system function VariantChangeTypeEx to convert the value to a double type, it returns an E_INVALIDARG error.

I am not sure in which layer this invalid VARIANT structure is being generated but I assume that the conversion from the internal Oracle floating point data format to the VARIANT type being presented to my application is part of the OLE DB provider and therefore this behaviour is caused by a problem at that level.

I can work around this problem for some aspects of what I need to do but the conversion call is buried at a low level in the RTL and therefore I get the error whenever any of the higher layer functions tries to access one of these  values

Any help would be appreciated

Jon

This discussion has been closed.