Hey, ih,
There is not a way to update status from a foreground query, because the query ties up JMP's main thread, so JMP really can't do anything while it's running.
The workaround I would suggest would be to use Query Builder to create your query (using Custom SQL if you already have the SQL you want to run), and then save the query as a file. Let's suppose it was named "oneMillionRows.jmpquery" on disk.
Then, write a script like this:
query = include("oneMillionRows.jmpquery");
query << Run Background(
On Run Complete(
Write("\!NQuery is complete! Rows in result: ", NRows(queryResult));
)
);
Whatever JSL you want to run after the query completes can go in the On Run Complete parameter to Run Background(). So JMP will still be usable while the query is running. The user could use View > Running Queries to see the progress. Whether or not there will be much progress to report depends on whether the query spends most of its time in the execution phase or in the data retrieval phase. We don't get any updates from the database during the execution phase; we just update the number of rows retrieved as we fetch the data from the database after the query executes.
Eric