1. Joe Hess
  2. PowerBuilder
  3. Thursday, 6 April 2023 00:20 AM UTC

Hi,

I plan to move one of our applications from traditional C/S to using APIs. The application uses query mode extensively. If the datawindow is not connected to a database, GetSQLSelect() does not include the entered criteria in the WHERE clause. 

My plan is to build/alter the WHERE clause by stepping through the column objects, extracting the entered text, and sending the resulting SQL statement to an API that users a dynamic IDatastore. This seems like a challenge since some pretty complex queries could be created by putting criteria on multiple lines, including different operators, etc.

We have another application that uses PowerServer 2022. Entering criteria in query mode works. Does anyone know how PowerServer handles query mode? Is there another way I can extract the updated WHERE clause after entering criteria in query mode?

Regards,

Joe

 

Accepted Answer
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 7 April 2023 08:41 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Joe, if there is no database connection at all (even no fake database) in the application, you can only try to implement your own QueryModel logic to replace the current DataWindow QueryModel.

You can also submit an enhancement ticket on our support portal (at https://www.appeon.com/standardsupport). This way, our product team will analyze this request when they plan to extend PB functions in the future.

Regards, Logan 

Comment
There are no comments made yet.
Joe Hess Accepted Answer Pending Moderation
  1. Friday, 7 April 2023 15:07 PM UTC
  2. PowerBuilder
  3. # 1

Yeah, that's what I've been doing. Most users search by primary key or something simple like a status. I have all of that covered for characters, longs, decimals, and dates. I'll put in what I can and as issues arise, adjust the process.

Thanks for your help.

Joe

Comment
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Thursday, 6 April 2023 05:31 AM UTC
  2. PowerBuilder
  3. # 2

Hi Joe,

I think you can look at the revised SELECT statement that is sent to the DBMS when data is retrieved with criteria. To do so, look at the sqlsyntax argument in the SQLPreview event of the DataWindow control. Refer to: https://docs.appeon.com/pb2022/datawindow_programmers_guide/XREF_23002_Providing_query.html

Regards, Logan

Comment
  1. Joe Hess
  2. Thursday, 6 April 2023 11:53 AM UTC
Hi, Logan.



Thank you for the reply. SQLPreview still requires SetTransObject. Since the connection is at the server, the datawindow does not have access to the DBMS to generate the proper syntax. For grins and giggles, I tried a Retrieve. That pops up the message saying the DBMS information is not available. I tried triggering the event. All parameters are null.



Joe
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 6 April 2023 15:09 PM UTC
Hi Joe;

FWIW: The other big feature that also needs to be supported is the "Query Sort" mode as well.

: I have not tried this feature in my PS 2022 testing yet .

Regards .. Chris
  1. Helpful
  1. Joe Hess
  2. Friday, 7 April 2023 15:13 PM UTC
Thankfully, we don't use that. For my grids, I added clicking the column headers to sort, similar to what the DevExpress grid does. There is also a menu option to sort the datawindow.



Maybe the engineers can tell us how they handle query mode with PowerServer since it works, there :)
  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.