Dovico.TrackITWSAPI.API.DatabaseExecuteQuery(System.String,Dovico.TrackITAPI.SessionToken)
Function Overview:
This method executes or buffers queries specified by sXml which is an xml string in the format query.xsd. The recommended use for this function is for SELECT statements only, and the example will show a SELECT.
Parameter List:
sXml - string - xml in the format query.xsd that contains the SQL to execute as well as other parameters
stToken - SessionToken - Session Information needed to process transaction
Returns
A string of xml results if it is a SELECT statement with CHUNKNUMBER=-1. If it is anything other than a select statement CHUNKNUMBER>=0, then an xml document with the CHUNKNUMBER specified is returned.
Example:
// execute a query to return all employees from the database as xml
string sXml = "<Query:QUERY xmlns:Query=\"http://www.dovico.com/schemas/query.xsd\" ";
sXml += "SQL=\"SELECT * FROM EMPLOYEE\" CHUNKNUMBER=\"-1\" TOTALCHUNKS=\"-1\" ASYNC=\"FALSE\"/>";
// execute the query, and get the results as a string variable
string sResultsXml = wsapi.DatabaseExecuteQuery(sXml, stToken);