CapableObjects forum



Oracle, Delphi 2006, Eco3, Bdp - decimal value problem

Posted By squirrels 2012-01-17 11:24:59
Add to Favorites0
Author Message
squirrels
 Posted 2012-01-17 11:24:59
Forum Newbie

Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)Forum Newbie - (6 reputation)

Group: Forum Members
Last Active: 2012-01-17 18:25:52
Posts: 1, Visits: 10
6
Hi,

I use Delphi 2006, ECOIII and BDP to connect to an Oracle 10g Database.
I have a problem retrieving decimal values from the database when I change the DecimalSeparator and ThousandSeparator in Windows.

In the eco model all types for decimal values are declared as type double, in the database all the value fields are number fields.
NLS settings for the database - NLS_NUMERIC_CHARACTERS; ,.

When the DecimalSeparator is set to , all values are retrieved correctly, but when changed to . all values are multiplied by 10, for ex.: 6,2 becomes 62

I tried to override this behavior by adding an Initialization string to the bdp connection string


this.bdpConnection1.ConnectionString = "assembly=Borland.Data.Oracle, Version=2.5.0.0,
Culture=neutral, PublicKeyToken=91d62ebb5b0d1b1b;vendorclient=oci.dll;pooling=True;
grow on demand=True;database="+_DBPath_Main+";username="+_userName+";
max pool size=100;password="+_passWord+";provider=Oracle;min pool size=0;
Initialization String=alter session set NLS_NUMERIC_CHARACTERS = ',.'";


but that had no effect.

Do you have any ideas or suggestions how to overcome this behavior?

The next thing I would try to do is to add the sql statement alter session set NLS_NUMERIC_CHARACTERS in an extra query at program start and not in the connection string, maybe this will help.

Or can I add something like a persistenceMapper for all decimal values retrieved from the database where I convert the values according to the DecimalSeparator settings in Windows?

Thanks for your help in advance.

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top