I want to build a procedure that will take in a query string, dynamically run it and display the results into a grid. I've done that using code like this:
DEF VAR vBuffer AS HANDLE NO-UNDO.
DEF VAR vQuery AS HANDLE NO-UNDO.
CREATE BUFFER vBuffer FOR TABLE txtTable:SCREEN-VALUE.
CREATE QUERY vQuery.
Code to insert into the grid...
This works great but now I want to scale it up and make it so it works if I am doing a query that is querying against two (or more) tables. As you can see, this only works for one table because I'm creating the buffer for the table that is entered and the query for the query that is entered.
I know you can have more than one buffer for the SET-BUFFERS function but my problem is that I don't know how many buffers I need until the user tells me.
Any good thoughts or suggestions on how to approach this?