1. Miguel Leeuwe
  2. PowerBuilder
  3. Tuesday, 22 February 2022 17:33 PM UTC

Today if been trying to get the Sales Demo application to work with Postgresql 13.6.

The on the Github suggested database didn't restore (reported as a bug and will be fixed).

After being pointed to another working version of the database by Mark Lee ( 

https://github.com/Appeon/PowerBuilder-Project-Example-Database ), when running the app and clicking on the Order button I'm getting errors.

- When opening some datawindows, for none of them it seems to be possible to convert the datasource to 'graphics mode' the simplest select fails to convert.

And then there is this Select that fails in any mode, giving me an error

"

---------------------------
DataWindow
---------------------------
Database error:

SQLSTATE = 42883
ERROR: operator does not exist: boolean = integer;
No query has been executed with that handle
---------------------------
OK
---------------------------

": 

The problem seems to be the "FinishedGoodsFlag = 1", if I change the = 1 to be = true, it works:

SELECT
        Production.Product.Name                         ,
        Production.Product.ProductNumber                ,
        Production.Product.Color                        ,
        Production.Product.ListPrice                    ,
        Production.Product.Size                         ,
        Production.Product.ProductSubcategoryID         ,
        Production.Product.ProductModelID               ,
        Production.ProductCategory.Name                 ,
        Production.ProductSubcategory.ProductCategoryID ,
        Production.ProductSubcategory.Name              ,
        Production.ProductModel.Name                    ,
        Production.Product.ProductID
FROM
        Production.Product         ,
        Production.ProductCategory ,
        Production.ProductModel    ,
        Production.ProductSubcategory
WHERE
        (
                Production.ProductModel.ProductModelID = Production.Product.ProductModelID )
and     (
                Production.ProductSubcategory.ProductCategoryID = Production.ProductCategory.ProductCategoryID )
and     (
                Production.ProductSubcategory.ProductSubcategoryID = Production.Product.ProductSubcategoryID )
and     (
                ( Production.Product.FinishedGoodsFlag = 1 )
        and     (
                        Production.Product.ProductID in
                        (
                                SELECT
                                        Sales.SpecialOfferProduct.ProductID
                                FROM
                                        Sales.SpecialOfferProduct ) ) )
ORDER BY
        Production.Product.ProductID ASC

 

I've seen in the ODBC configuration that there's an option called "bools as char". I've tried to un-check it, but it doesn't make any difference.
Is there some kind of a DB parm I can set to avoid having to change all flags to boolean TRUE or FALSE?

 

 

TIA

MiguelL

 

Accepted Answer
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 23 February 2022 04:52 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Miguel,

 

Please refer to the instructions in the readme.md file on the Sales Demo application on Git,

https://github.com/appeon/powerbuilder-sales-example

This PB code applies only to the SQL Anywhere database and does not use the PostgreSQL database.

The issue you have is due to that DataWindow has different support syntax for different database.

 

If you want the Sales Demo application code corresponding to the PostgreSQL database, at this moment, you need to choose PostgreSQL when installing PB with the AppeonInstaller tool. It will automatically download the corresponding PB Sale Demo application code.

 

You can get the installer from our Downloads portal at

https://account.appeon.com/download (login required).

 

Regards,

 

Comment
  1. Miguel Leeuwe
  2. Wednesday, 23 February 2022 09:32 AM UTC
Yes, it turns out that when you request a trial version, you get a welcome e-mail which points to the Github version. I didn't realize that the github version isn't needed, since when choosing Postgresql when installing powerbuilder, you already have the correct database. So the local demo of the sales order app will work, whilst on Github, it assumes you only work with sqlAnywhere and there's no other database version. I stupidly assumed all demos would have been adapted, including the ones on Github.

Case closed,

regards

For anyone interested: https://www.appeon.com/standardsupport/search/view?id=7991

  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Wednesday, 23 February 2022 17:45 PM UTC
  2. PowerBuilder
  3. # 1

Miguel -

  Here's what I use to connect to a PG database adn I have no issues getting to the Graphic mode or the Syntax mode.






 

Comment
  1. Miguel Leeuwe
  2. Wednesday, 23 February 2022 20:28 PM UTC
Hi Olan,

Thank you for that information. The problem has been solved though: it turns out there's different versions for the salesdemo application for Postgresql, except that they don't publish that one on Github, you have to install it along PB when doing the installation, which crazy enough, I DID. I just didn't realise it would be there, since I got a 'welcome' email with a link to the Github site. The one on Github is SQLAnywhere only.

regards and thanks!

MiguelL
  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.