1. Derek Hammonds
  2. PowerBuilder
  3. Wednesday, 28 August 2019 14:26 PM UTC

Our large applications use SQL Anywhere 12 and ODBC.  We are using Powerbuilder 17 Build 1880.

 

If you try to put a very simple and very basic query into a datawindow such as...

SELECT "budget"."consumer_id", 0.00 as ohcrap
FROM "budget"

then the resulting datawindow translates the 0.00 as a decimal(0).

Prior to PB 2017 this was always mapped CORRECTLY as a decimal(2) or whatever.

Now, in PB 2017, this is mapped INCORRECTLY as decimal(0).  Basically a big integer.  No precision.

 

Editing any existing datawindow that has a literal (real type) coded in this way results in the same BUG: the field is RE-MAPPED incorrectly as a decimal(0).

This is a bug.  This is a problem.

Regular database fields are still mapped correctly, FYI.

 

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 28 August 2019 15:14 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

Maybe you can work around it by doing this in your select:

example:

select convert( decimal(38,2), 0.00) as myDecimalField from dummy

 

by using the convert function it does generate the correct type. I know, "not ideal" but it works.

release 17;
datawindow(units=0 timer_interval=0 color=1073741824 brushmode=0 transparency=0 gradient.angle=0 gradient.color=8421504 gradient.focus=0 gradient.repetition.count=0 gradient.repetition.length=100 gradient.repetition.mode=0 gradient.scale=100 gradient.spread=100 gradient.transparency=0 picture.blur=0 .....

......

........

table(column=(type=decimal(2) updatewhereclause=yes name=mydecimalfield dbname="mydecimalfield" )
retrieve="select convert( decimal(38,2), 0.00) as myDecimalField from dummy" )

 

HIH,

regards

Comment
There are no comments made yet.
André Monz Accepted Answer Pending Moderation
  1. Wednesday, 28 August 2019 15:18 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

a   cast(0 as decimal(8,2)) as ohcrap should to the job.

 

hth

Comment
There are no comments made yet.
Derek Hammonds Accepted Answer Pending Moderation
  1. Wednesday, 28 August 2019 15:19 PM UTC
  2. PowerBuilder
  3. # 3

Thank you for your response, Miguel.  That does look like it would work as a workaround.  Right now we have just been doing an 'edit source' and manually changing the values from decimal(0) to decimal(2) or whatever.  

I'm really trying to get Appeon to acknowledge this for the BUG that it is and would sleep better knowing they are working towards fixing it in a timely manner.

 

Thanks,

Derek

 

Comment
  1. Miguel Leeuwe
  2. Wednesday, 28 August 2019 15:42 PM UTC
YW,

yes, the problem of simply editing the source code and changing the (0) to (2) would be that if anyone does a change on the datawindow's select anytime in the futere, the (2) would automatically change back to (0) and you might not be aware of that.

For that reason the Convert() or Cast() (as suggested by André Monz) is the better way to go.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 28 August 2019 15:19 PM UTC
  2. PowerBuilder
  3. # 4

It's interesting to see the following also. PB or ODBC interface only seems to look at "significant" decimals.

If you do this, without any convert:

---

select 0.00 as zeroField, 1.23 as nonZeroField from dummy

then you'll get:

---

decimal(0) for a value of 0.00 and  

decimal(2) for a value of 1.23

 table(column=(type=decimal(0) updatewhereclause=yes name=zerofield dbname="zerofield" )
column=(type=decimal(2) updatewhereclause=yes name=nonzerofield dbname="nonzerofield" )
retrieve="select 0.00 as zeroField, 1.23 as nonZeroField from dummy
" )

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 28 August 2019 15:28 PM UTC
  2. PowerBuilder
  3. # 5

Hi Derek;

  FYI: Same issue in PB2019. The "Cast()" workaround suggestion though works great in all newer PB's with SA16/17 (in my testing) today.

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 28 August 2019 17:49 PM UTC
PS: Please open a support ticket for this issue: https://www.appeon.com/standardsupport

Many thanks in advance!
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 28 August 2019 17:39 PM UTC
  2. PowerBuilder
  3. # 6

Is this something that updating the pbodb###.ini file can fix?

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.