1. Richard Carrier
  2. PowerBuilder
  3. Friday, 6 September 2019 20:19 PM UTC

We are having an issue where a search datawindow, that uses a Stored procedure as the data source just does not seem to work properly in Query mode. Any other datawindow works along with views.

 

Has anyone else had this work. Meaning building a datawindow using a SP and then applying query mode

 

Thanks in advance to any help

 

Richard

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 6 September 2019 21:14 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Richard;

  FYI: The DWO's "Query Mode" will only work with its own internally built SQL or an assigned View. In either of those two cases, the DWO can have access to the full SQL "Select" statement. Then once its sees the Query Criteria, it can then manipulate its SQL accordingly. In the case of an SP based DWO - the DWO does not see any SQL. Just a call to a remote DB object with some optional parameters.

  FWIW: If you intend on using the SP as the DWO's data source, I would write your own PowerScript to introspect the DWO's state after taking out of Query mode and then apply the appropriate "Where" criteria changes to the SP calling parameter list as required. The other alternative would be to capture your own criteria in a custom dialogue  and then use that to fire the SP based DWO with the appropriate parameters.

     The last alternative would be to have two DWO's - one for normal SP use and one for Query Mode and swap out the SP DWO for the SQL based DWO when doing Query Mode operations and then just let the SQL based DWO handle the DB Query from the PB client side.

Food for thought.

HTH

Regards ... Chris

 

 

 

Comment
  1. Richard Carrier
  2. Saturday, 7 September 2019 00:04 AM UTC
Hi Chris,



Fantastic reply. Thanks !
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 6 September 2019 21:09 PM UTC
  2. PowerBuilder
  3. # 1

that won't work.

querymode CHANGES the where clause of the datawindow at runtime

 

if you really must use a stored procedure, then you would need to create a fake querymode like setup

 

 

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.