1. Eszter Zsigmond
  2. PowerBuilder
  3. Friday, 24 May 2019 15:43 PM UTC

I'm experiencing an issue with Describe function in Powerbuilder 2017 R3. If I call Evaluate within the Describe function, then it gives me a wrong result, when I change the HKCU/Control Panel/International/sDecimal entry in the registry from a dot (.) to a comma (,), and there is a decimal value in the expression within Evaluate. It seems, it cuts off the part after the decimal point in the decimal values (e. g. 1.5*3 evaluates to 3). I'm using Oracle Database 12c with PB. (It works fine, if the sDecimal entry is set to a dot. )

Can you give me an advice, how to resolve this problem?

BR,

Eszter

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 24 May 2019 16:05 PM UTC
  2. PowerBuilder
  3. # 1

Hi Eszter ;

   This is what I use in my Oracle 18C connections out of PB 2017/2019 when in the App is being used by a French speaking Canadian User ...

SQLCA.DBParm = " Async=1,DBGetTime=5,DecimalSeparator=',' "

   Try controlling the separator via the DBParm setting as above. It should work in O12C as well AFAIK. You can then set this value based on the user's language, region, etc of where the App is running.

HTH

Regards ... Chris

Comment
There are no comments made yet.
Eszter Zsigmond Accepted Answer Pending Moderation
  1. Friday, 24 May 2019 16:36 PM UTC
  2. PowerBuilder
  3. # 2

Hi Chris,

thank you for your answer. I've already tried that, but unfotunately it doesn't work. I've also changed the value of the NLS_NUMERIC_CHARACTERS in the session (alter session set NLS_NUMERIC_CHARACTERS=', '), but it had no effect either.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Sunday, 26 May 2019 00:35 AM UTC
  2. PowerBuilder
  3. # 3

Well, I have an ugly work-around....

1) Ceate a function that handles decimal math U_NV_DECIMAL_MATH (parm1, parm2, operation) RETURNS decimal

2) In this function, first update the Registry to set the decimal separator to a dot

3) do your math

4) Results are saved int he output variable

5) The Registry is reset to the original separator format.

Now whenever you have a need to do this kind of math, you call this function.

This is a feasible workaround only if you do not have a bajillion places where decimal math is occuring.

 

Olan

 

 

Comment
There are no comments made yet.
Eszter Zsigmond Accepted Answer Pending Moderation
  1. Tuesday, 28 May 2019 15:51 PM UTC
  2. PowerBuilder
  3. # 4

I've found further issues in connection with the original one:

if HKCU/Control Panel/International/LocaleName is set to a language code with a sub-form of the language (e.g. en-US), and the HKCU/Control Panel/International/sDecimal entry is set to anything, except dot (.), then PB gives a wrong result to string-double conversion (e.g double('1.5') evaluates to 1). If I change the Localename entry to a language code without a sub-form (e.g. hu), then the string to double conversion works alright.  Evaluate also gives me a right result with this modification. However, I don't want to modify LocaleName (its current value is en-US). Do you have any idea, where does PB use this registry entry, and how can I fix this problem? (I tried to trace it with Process Monitor, but it gives me no result.) 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.