Evgeny Shvarov · Oct 22, 2017

How to Cancel The Execution of a Long Query in DeepSee

Hi, folks!

Suppose you called an MDX which takes a really long period of time.

Is there any way to cancel its execution programmatically?

1 0 2 254


YES it is !

Class %DeepSee.ResultSet has a method %CancelQuery that does the trick.

Chapter  Using the Result Set API tells you some more details.


If you used %ExecuteAsynch(), periodically check to see whether the query has completed. If the query uses any plug-ins, make sure that any pending results are also complete; pending results are the results from the plug-ins, which are executed separately from the query.

To determine the status of the query, call the %GetStatus() method of your instance. Or call the %GetQueryStatus() class method of %DeepSee.ResultSet. These methods return the status of the query and also (separately) the status of any pending results; see the class documentation for details.

Optionally, to cancel a query that has not yet completed, call the %CancelQuery() class method.

A practical example is seen in ##class(%DeepSee.UI.Analyzer).onunloadHandler()

Thanks, Robert! That was fast.