<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.spherecommunity.net/index.php?action=history&amp;feed=atom&amp;title=AQUERY</id>
		<title>AQUERY - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.spherecommunity.net/index.php?action=history&amp;feed=atom&amp;title=AQUERY"/>
		<link rel="alternate" type="text/html" href="https://wiki.spherecommunity.net/index.php?title=AQUERY&amp;action=history"/>
		<updated>2026-05-05T11:17:24Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://wiki.spherecommunity.net/index.php?title=AQUERY&amp;diff=586&amp;oldid=prev</id>
		<title>RanXerox: added categories</title>
		<link rel="alternate" type="text/html" href="https://wiki.spherecommunity.net/index.php?title=AQUERY&amp;diff=586&amp;oldid=prev"/>
				<updated>2010-11-06T18:32:53Z</updated>
		
		<summary type="html">&lt;p&gt;added categories&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:32, 6 November 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l93&quot; &gt;Line 93:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 93:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RETURN&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;RETURN&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/spherescript&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/spherescript&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Reference Compendium]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Properties and Functions]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RanXerox</name></author>	</entry>

	<entry>
		<id>https://wiki.spherecommunity.net/index.php?title=AQUERY&amp;diff=512&amp;oldid=prev</id>
		<title>MrSugarCube: Created page with '__FORCETOC__  ==Description== This function will queue up a query and run it asynchronously in a background thread (rather than the script waiting for it to complete like the [[Q...'</title>
		<link rel="alternate" type="text/html" href="https://wiki.spherecommunity.net/index.php?title=AQUERY&amp;diff=512&amp;oldid=prev"/>
				<updated>2009-08-01T16:10:51Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;__FORCETOC__  ==Description== This function will queue up a query and run it asynchronously in a background thread (rather than the script waiting for it to complete like the [[Q...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This function will queue up a query and run it asynchronously in a background thread (rather than the script waiting for it to complete like the [[QUERY]] function). Once the query has been executed, a specified callback function will run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike the [[QUERY]] function, results are not stored in the [[ROW]] object. Instead they are passed in to the callback function as [[LOCAL]]s. The following table shows the differences between accessing the results for the two functions:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
| [[QUERY]] || [[AQUERY]]&lt;br /&gt;
|-&lt;br /&gt;
| [[ROW]].NUMROWS || LOCAL.NUMROWS&lt;br /&gt;
|-&lt;br /&gt;
| [[ROW]].NUMCOLS || LOCAL.NUMCOLS&lt;br /&gt;
|-&lt;br /&gt;
| [[ROW]].''row_index''.''col_index'' || LOCAL.''row_index''.''col_index''&lt;br /&gt;
|-&lt;br /&gt;
| [[ROW]].''row_index''.''col_name'' || LOCAL.''row_index''.''col_name''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Note 1''''': An open database connection is required for this function to work correctly. See the [[CONNECT]] function for information regarding the opening of a database connection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Note 2''''': The [[AQUERY]] and [[QUERY]] functions are intended to run SQL commands that return results (such as SELECT). For commands that do not return results consider using the [[AEXECUTE]] and [[EXECUTE]] functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Valid for the following objects:&lt;br /&gt;
* [[Database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;tt&amp;gt;AQUERY ''function'', ''command''&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
| '''Argument''' || '''Type''' || '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| ''function'' || string || A script function to call when the command has been executed.&lt;br /&gt;
{| cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
| '''Argument''' || '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| ''ARGN1'' || The type of command (0 = [[AEXECUTE]], 1 = [[AQUERY]])&lt;br /&gt;
|-&lt;br /&gt;
| ''ARGN2'' || 0 = Command failed, 1 = Command succeeded.&lt;br /&gt;
|-&lt;br /&gt;
| ''ARGS'' || The command that was executed.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| ''command'' || string || The SQL command to execute.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return Values==&lt;br /&gt;
This function returns one of two values when executed. See the table below for the meanings of the return values:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
| '''Return Value''' || '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Command has not been successfully queued.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Command has been successfully queued.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;spherescript&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
// Queues an SQL query.&lt;br /&gt;
//&lt;br /&gt;
[FUNCTION f_aquery]&lt;br /&gt;
SERV.LOG Selecting some values in the background.&lt;br /&gt;
IF (&amp;lt;DB.AQUERY f_aquery_callback, SELECT 10 AS test1, 20 AS test2, 30 AS test3&amp;gt; == 0)&lt;br /&gt;
  SERV.LOG Failed to queue command.&lt;br /&gt;
ELSE&lt;br /&gt;
  SERV.LOG Command queued.&lt;br /&gt;
ENDIF&lt;br /&gt;
RETURN&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
// This function will be called when the query has been executed.&lt;br /&gt;
//&lt;br /&gt;
[FUNCTION f_aquery_callback]&lt;br /&gt;
IF (&amp;lt;ARGN2&amp;gt; == 0)&lt;br /&gt;
  SERV.LOG The command failed to execute. (&amp;lt;ARGS&amp;gt;)&lt;br /&gt;
ELSE&lt;br /&gt;
  SERV.LOG The command succeeded, &amp;lt;dLOCAL.NUMROWS&amp;gt; row(s) of data returned. (&amp;lt;ARGS&amp;gt;)&lt;br /&gt;
  FOR 0 &amp;lt;EVAL &amp;lt;LOCAL.NUMROWS&amp;gt; - 1&amp;gt;&lt;br /&gt;
    SERV.LOG #&amp;lt;EVAL &amp;lt;LOCAL._FOR&amp;gt; + 1&amp;gt;. &amp;lt;LOCAL.&amp;lt;dLOCAL._FOR&amp;gt;.test1&amp;gt;, &amp;lt;LOCAL.&amp;lt;dLOCAL._FOR&amp;gt;.test2&amp;gt;, &amp;lt;LOCAL.&amp;lt;dLOCAL._FOR&amp;gt;.test3&amp;gt;&lt;br /&gt;
  ENDFOR&lt;br /&gt;
ENDIF&lt;br /&gt;
RETURN&lt;br /&gt;
&amp;lt;/spherescript&amp;gt;&lt;/div&gt;</summary>
		<author><name>MrSugarCube</name></author>	</entry>

	</feed>