A PowerBuilder datawindow has some parameters and those parameters are obviously matched with columns in query of the datawindow. The query is too complex. In my script i get the query syntax in a string variable. Also i get parameters list defined in the datawindow. Now i want to get the list of columns from the query syntax where columns are being compared with retrieval arguments. I do not need those columns where column is not compared with retrieval argument.
for example query string has in its text "product_price >= :prod_price AND SupplierID is null AND store_id = :storeID"
I want to get all the columns names excluding supplierID because supplierID is not compared with any retrieval argument. The Query is too complex with many case statements and operators.
Is there any easy way to get columns list from the query string without involving complex string parsing script?
And the fun part of the solution you suggested is in fact the real question. And i know there is no easy way to do that. I am already having fun coding in PowerBuilder. Thanks but no thanks.
FWIW: The GetSQLSyntax and SQLPreview event argument are functionally the same. The only benefit of the SQLPreview is that can be more accurate, as its at the point where the real SQL is being generated to be sent over to the DBMS. If your App has performed Modify ( ) commands that may alter the SQL generation, the SQLPreview event will show them. Depending on when you use the GetSQLSelect (old PB feature before the SQLPreview), the SQL may not be as accurate.
Food for thought .... Just my $0.02.
Regards ... Chris