Quantcast
Channel: SCN: Message List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 7329

Re: Dynamic datawindow with parameters, how to modify sql select?

$
0
0

I've never had very much use for SETSQLSelect.  I mean, building datawindows is easy.  Manipulating them in PowerScript with dot notation or Modify() is much, much more difficult.

 

1) I'll build two or more datawindows with the different SQL statements, and swap them in as the .dataobject based on the value in the parameter.  (Yes, that means I have more places to change if there's a new user requirement, so bear that in mind.)

 

Or

 

2) Most simple tweaks to the SQL of a datawindow with parameters can be based off of the values in those parameters with CASE statements.  For example, if the value of a parameter drives the selection of one column or another:

 

Select

  col1,

  col2,

  CASE :param1

     WHEN 'something' THEN col3

     WHEN 'something else' THEN col4

  END CASE

from someTable

where ...


Viewing all articles
Browse latest Browse all 7329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>