Data Query
Data query is a quick tool to retrieve data from database by using JavaScript function at client side. The query will performed at a stored procedure, and the stored procedure should return a single record as a valid XML string.
CREATE PROCEDURE dbo.my_query_proc_name
@userId VARCHAR(50),
@param VARCHAR(200) = NULL
AS
	SELECT data columns 
	FROM tables
	(WHERE optionally use @param)
	FOR xml auto, elements
To use data query from JavaScript function (the xml node path is case sensitive), below is an example:
var oxml = doXmlQuery('my-ref-key' [,param]);
if(oxml)
{
	var myVal1 = oxml.selectSingleNode('/your/own/xml/path1').text;
	var myVal2 = oxml.selectSingleNode('/your/own/xml/path2').text;
}
param in JavaScript function doXmlQuery is an optional argument. This value will be finally routed to the data query's stored procedure through parameter @param. If you need to pass parameter(s) to your stored procedure, use this optional argument.
Data Query Attributes
  • Query Name: Name of data query;
  • Reference Key: Data query's unique reference key;
  • Stored Proc: Stored procedure to perform the query from database;
  • Database: Database to host the Stored Proc;
  • Description: Description of the data query.