1. John Valentin
  2. PowerBuilder
  3. Thursday, 15 July 2021 13:59 PM UTC

We have a fairly large PowerBuilder application that is used to run our business.

We are working on a 2 way messaging module and there are lots of messages.

In our database (SQL Server), the message id number (used to uniquely identify the record) is the datatype BIGINT

(this is a 2^64). Does the datawindow support this type yet? I only see options for long and ulong, which I'm pretty sure are still 32 bit numbers...

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 15 July 2021 19:10 PM UTC
  2. PowerBuilder
  3. # 1

BigInt Test ... this error was at 20 digits. 19 digits works OK. Thus the DWO cannot handle 2^64 as that would be into the 20 digit range. I suspect that the DWO's 19 digit limitation might stem from the Decimal data type's "sign" support (+/-) taking up the 20th digit - thus 19 digits becomes the MAX (just my 1st thought) ...

Comment
  1. Benjamin Gaesslein
  2. Monday, 19 July 2021 07:51 AM UTC
Try entering 9,223,372,036,854,775,807 and then 9,223,372,036,854,775,808. The second one should fail.
  1. Helpful
  1. Benjamin Gaesslein
  2. Monday, 19 July 2021 08:18 AM UTC
It's also not true that the sign takes up a digit. You can assign both 1234567890123456789012345678 and -1234567890123456789012345678 to a decimal variable and it will work.

Interestingly, despite what the help file says, I've found that I could actually fit numbers of up to 30 digits (positive or negative) into a decimal variable. 31 digits results in a value of 0.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 19 July 2021 17:07 PM UTC
Hi Ben;

Yes, I agree ... the Decimal data type will actually hold more. For example, the INT data type will actually hold up to 84K internally (during computations as a pace holder) but coughs at 32K in the DWO. However, the DWO is older and because it comes from the old 8 / 16bit world originally - has a few more restrictions on how it handles certain data types. Decimals in the DWO originally were only 15 digits and then later this was upgraded to 28 digits. So there are certainly some need attention / retrofitting required to the DWO to bring it "up to snuff" 202x wise (ie: Boolean, BigInt and BIT).

Regards ... Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 15 July 2021 18:21 PM UTC
  2. PowerBuilder
  3. # 2

Hi John;

  Yes, you are correct .. the BigInt data type is interpreted by a DW as "Decimal(0)" but that limits you to 28 digits. If you exceed that, the following error will occur ...

SQLSTATE = 22003
Microsoft SQL Server
Arithmetic overflow error converting expression to data type bigint.

  The proper full support for the SS BIGINT data type would need to treated as an enhancement as the DWO would need to treat this as a LongLong data type (I think).

Regards ... Chris

 

Comment
  1. Roland Smith
  2. Thursday, 15 July 2021 18:30 PM UTC
You are right, LongLong in script is 64bit. The datawindow engine should allow for LongLong columns that match with the 64bit number datatype of the dbms.
  1. Helpful
  1. mike S
  2. Thursday, 15 July 2021 18:36 PM UTC
decimal(0) should work - 28 decimal places (digits) is more than the max value of 9223372036854775808 for bigint (19 digits)? maybe the datawindow isn't handling decimal(0) correctly?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 15 July 2021 19:01 PM UTC
Hi Mike;

You could be correct on that one. I just did a test and the Decimal(0) => BigInt blows at 20 digits in the DWO.

I'll post a picture next of the test.

Regards ...Chris
  1. Helpful
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.