Dynamic Query Break BY

Lesley MacMahon

New Member
Hi there,

Can anyone steer me in the right direction? I have written a dynamic viewer program that allows users to select a table, input query criteria and view the result. We have an application that picks up the where-clause criteria (a querybox application). My program picks up this where-clause, builds a dynamic temp-table for the selected table, assigns it the result of the dynamic query and displays the data in a dynamic browse. This is all working fine but the user wants summary type information, ie break by accumulate totals, counts averages etc. I have worked out the break by bit and realise I could program the totals, counts etc and add these additional fields onto my dynamic temp-table. The trouble is the user has to have the facility to total or average any field in the table. My boss has asked the question - would it not be easier in SQL. I have no knowledge of the progress SQL engine but have tried out a few queries via the interface.

My question is can I programmatically initiate the SQL query from my program, capture the result set in a progress temp-table so that I can pass this temp-table to my viewer's browse?

Any suggestions would be greatly appreciated. Thanks
 
The only Progress SQL engine which will interact with a temp table is the SQL-89 engine which is built in to the 4GL. However for longevity I believe this to be a bad idea since PSC are looking into removing it and adding an SQL-99 engine to be used in the same way as the SQL-92 engine (i.e. Different Broker/servers from the 4GL).

How about providing a facility that will simply scan through the temp table you build (once it is populated) and do the total/average/whatever that the client needs based on certain key fields.
 
Back
Top