Link to home
Start Free TrialLog in
Avatar of gjbaker
gjbaker

asked on

UpdateSQL component dropping decimals

Here's the problem we're having.  We are using Delphi 3, and we jusr recently upgraded from Oracle 7.3 to Oracle 8i.  Thus we upgraded the BDE to version 5.01 and our Oracle client to 8.05.  Plus we are now using the SQLORA8.DLL.
We use cached updates everywhere and many UpdateSQL objects.  We are now experiencing a problem with Oracle numeric fields that allow digits to the right of the decimal point. (Numeric(20,2))  Our TField for these columns are TBCDField and we have EnableBCD set to TRUE in our BDE.  The problem is when we ApplyUpdates to one of these tables, any number (ex. 1.75) is dropping the decimal point entirely.  (It's in Oracle as 175)  I have traced it into the UpdateSQL component and the value seems to be correct.  However, using SQL monitor, the value being passed to Oracle is NOT.  In testing I have found that it has something to do with this component.  There are other datasets that work that do NOT have an UpdateSQL component.  As soon as I add one, it breaks.

If you have any suggestings, or if you know this is a known problem it would be appreciated.

Greg Baker
Avatar of Pegasus100397
Pegasus100397

gjbaker,

  Are you certain your not using an integer in the updateSQL component? Sounds like a translation problem between the BDE and whatever driver (ODBC?) your using to connect to Oracle. I'm also assuming that the data went correctly with version 7.3. Check your precision within the BDE and if your using ODBC, put a trace on it (log file) to determine if the data is being altered before being sent to the server. Check also your docs (in Oracle v8) for the Numeric datatype and make sure they didn't make any changes to the way this data is stored between v 7.3 & 8

Good luck with you project!
Pegasus
Avatar of kretzschmar
hi gjbaker,

? why must it be a bcd-field (maybe its no BCD and the decimalpoint is lost during the conversions) ?
? what happens if you turn off enable bcd ?

meikl
Avatar of gjbaker

ASKER

Pegasus,

An UpdateSQL object does not define any datetypes.  We are using the Native Oracle 8i driver included in the BDE.  The exact code worked fine (with the same table definitions) on Oracle 7.3, using the native Oracle 7.3
driver in the BDE 5.01.
Do not use BCD numbers. They are for integer numbers only.

Alex
gjbaker? Are you there?

Alex
Avatar of gjbaker

ASKER

Alex,

I'm removing all the BCD fields and changing to Floats.  The TFloatFields seem to be working better.  I still think there is a bug in the Borland SQLORA8.DLL Oracle driver.
Thanks for the help, at least I found a work around.

Greg
ASKER CERTIFIED SOLUTION
Avatar of simonet
simonet
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial