Hi All,
I have a script that runs several SQL queries in parallel to get around the character limit in the ODBC driver/SQL server since we frequently need to pull in data for WHERE clauses containing many thousands of strings, e.g "SELECT * FROM [Table] WHERE [id] IN ('id000000001','id000000002',...'id000010000')". My method for doing this works fine, (iterate through a list of queries doing <<Run Background, inserting queryResult into a global list (::l_result_tables) in On Run Complete and updating global counter variables (::n_complete, ::n_error) to handle completion/error counts in both On Run Complete and On Error, then afterwards just awaiting (::n_complete+::n_error)==n_queries) but this generally runs faster and more smoothly if the Private flag is passed to <<Run Background. After all queries have completed or failed, I concatenate/append ::l_result_tables[2::N] onto ::l_result_tables[1], then close tables 2::N. Finally, I check to see if table 1 << Has Data View and if not, send it a New Data View message to display it for the user.
All of that is to say, when I send the new data view message, clearly the "private" flag on the table is not reset, because the table does not show up in the table list on the main window. Is there a way to reset or clear the private flag on the table, or do I have to generate the table as non-private during the <<Run Background call? I've noticed that when closing the new data view, the "blank" space in the table list on the main window remains, which tells me that the table is still in memory. Calling Close(dt_results, No Save) on the private table does seem to work, as does Close All(Data Tables), but if the end user just closes the window they wind up with a potentially huge memory leak (private table they don't know about with millions of rows).
Robert Maltby