#1 2013-04-03 20:35:42

peak.tibor
Member
Registered: 2013-02-22
Posts: 19

suggest another 'ALTER SESSION...' in SynDBOracle.Pas

In the TSQLDBOracleConnection.Connect procedure there is the following useful statement:

Execute('ALTER SESSION SET NLS_DATE_FORMAT=''YYYY-MM-DD-HH24:MI:SS''',false);

I suggest to also include the following one:

Execute('ALTER SESSION SET NLS_NUMERIC_CHARACTERS=''' + DecimalSeparator + ThousandSeparator + '''',false);

This would help us who use not the '.', but the ',' as a decimal separator (e.g. in Hungary, where I live).
As I experience, the Thousandseparator is not automatically used, but the DecimalSeparator YES, so I included this statement into my library.

Tibor

Offline

#2 2013-04-04 15:10:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,007
Website

Re: suggest another 'ALTER SESSION...' in SynDBOracle.Pas

In fact, we have sometimes a problem with the classes, when we retrieve some floating point values.
We expect "." as decimal separator when ftCurrency kind of columns - e.g. for those defined as NUMBER(19,4) - are returned as SQLT_STR content.
This content is expected to be written as JSON, in which the decimal separator is '.'.
So we forced NLS_NUMERIC_CHARACTERS to be ". " for the session.
See http://synopse.info/fossil/info/282c7df9ae

This is the reason why we must avoid SET NLS_NUMERIC_CHARACTERS=''' + DecimalSeparator + ThousandSeparator + '''' which will break ftCurrency / Number(19,2) values.
sad

It is up to the end-user client application to format the returned value as expected to its own locale culture.

Offline

#3 2013-04-05 06:34:06

peak.tibor
Member
Registered: 2013-02-22
Posts: 19

Re: suggest another 'ALTER SESSION...' in SynDBOracle.Pas

Thanks for the info.

Offline

Board footer

Powered by FluxBB