Skip to content

CamlSqlQuery

David Lidström edited this page Nov 11, 2017 · 1 revision

Home » CamlSqlQuery object

This is the object returned every time you use the camlsql.prepare method.

Methods

exec

Executes the query provided the SharePoint CSOM libraries are available

 CamlSqlQuery exec(function(error, result));
  • The parameter is a function that will be called when the operation is done
  • By default, the current ClientContext and Web will be used. The list will be retreived by the List Title that you specify in your query
  • returns the same CamlSqlQuery object again
camlsql.prepare("SELECT * FROM [List1] WHERE [Something] > ?", 42)
.exec(function(err, result) {
 if (err) { console.error("An error occured"); return; }
 console.log("result", result);
});

getXml

Return the CAML Query XML

string getXml([boolean isExec]);
  • isExec is an internally used parameter that will indicate that the query should be used for execution in the exec method. Currently it will simply remove the possible GroupBy part of the query

getListName

string getListName();

Returns the name of the list, parsed from the query