<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to stop an SQL query in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772662#M95319</link>
    <description>&lt;P&gt;I will give it a try.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2024 07:53:33 GMT</pubDate>
    <dc:creator>matteo_patelmo</dc:creator>
    <dc:date>2024-07-12T07:53:33Z</dc:date>
    <item>
      <title>How to stop an SQL query</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772571#M95299</link>
      <description>&lt;P&gt;Hello, I'm looking for a to stop a SQL query running in background from JSL, to close a script neatly in case the user wants to exit before the query is completed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using JMP 18.0.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 17:11:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772571#M95299</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2024-07-11T17:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop an SQL query</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772583#M95300</link>
      <description>&lt;P&gt;View / Running Queries -&amp;gt; Select query, press stop and hope for the best&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1720718930128.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66084i0457330FA33E5DDE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1720718930128.png" alt="jthi_0-1720718930128.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;No cancel commands here &lt;A href="https://www.jmp.com/support/help/en/18.0/index.shtml#page/jmp/sql-messages.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/index.shtml#page/jmp/sql-messages.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From &lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/sql-functions.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/sql-functions.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1720719266351.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66085i1B90DAA7CB16FAF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_1-1720719266351.png" alt="jthi_1-1720719266351.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So you might want to contact JMP Support about how JMP handles situations where user closes JMP before the background query finishes (does it just leave running query without any cancel message to database and let database manage with the open query? hopefully not). Post back if you get a good answer from JMP Support&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 17:36:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772583#M95300</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-11T17:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop an SQL query</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772588#M95303</link>
      <description>&lt;P&gt;I'm not sure if this really does anything but you can also try using that window and press OK on each of the queries. I'm not sure if it is enough to just press the stop or do you have to also wait for all the queries to be stopped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is just an example which hasn't been tested&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

Main Menu("Running Queries");
wait(2);

ws = Get Window List(); // you maybe can trust that last is Running Queries
idx = Contains(ws &amp;lt;&amp;lt; get window title, "Running Queries");

mywindow = ws[idx];
gdb = mywindow[GridBox(1)];

// get list of all open queries (not implemented here as I cannot currently test it)
queries = gdb[1] &amp;lt;&amp;lt; get;
queryrows = {};
For Each({query, idx}, queries,
	If(query != "        ",
		Insert Into(queryrows)
	);
);

gdb &amp;lt;&amp;lt; Set Selected Rows({queryrows});
(mywindow &amp;lt;&amp;lt; XPath("//ButtonBox[text() = 'Stop']")) &amp;lt;&amp;lt; Click(1);

// maybe needs some sort of While loop or Schedule to check if all queries have closed?&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jul 2024 19:23:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772588#M95303</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-11T19:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop an SQL query</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772661#M95318</link>
      <description>&lt;P&gt;Thanks Jarmo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the menu command is already a partial solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the scripting,&amp;nbsp;I have contacted JMP support, I'll let you know.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 07:53:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772661#M95318</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2024-07-12T07:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop an SQL query</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772662#M95319</link>
      <description>&lt;P&gt;I will give it a try.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 07:53:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/772662#M95319</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2024-07-12T07:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop an SQL query</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/773234#M95412</link>
      <description>&lt;P&gt;This is the feedback I got from JMP Support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;There are no known JSL methods to stop SQL statements as View &amp;gt; Running Queries &amp;gt; Stop does. Close Database Connection () is the only JSL method that may appear to behave this way. However, it only closes the connection. It does not stop the SQL. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Closing JMP kills all the database connections. If a query is being executed by the database when you close JMP, closing JMP does not kill that execution. The database will eventually see an idol connection or killed connection and self-terminate the execution of the SQL.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 06:59:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stop-an-SQL-query/m-p/773234#M95412</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2024-07-16T06:59:18Z</dc:date>
    </item>
  </channel>
</rss>

