Reference Guide > TDV Built-in Functions for XQuery > executeStatement
 
executeStatement
This function executes the given SQL statement.
Syntax
composite:executeStatement ($statement as item(), $arguments as node()*)
Example
declare variable $values := <a><b>1</b><b>3</b></a>;
composite:executeStatement ('SELECT * FROM /shared/examples/ds_inventory/products WHERE ProductID > {0} AND ProductID < {1}', $values//b)
Result
The output is of the form document():
<results>
<result>
<ProductID>2</ProductID>
<ProductName>Mega Zip 750MB USB 2.0</ProductName>
<ProductDescription>Mega Zip 750 MB</ProductDescription>
<CategoryID>1</CategoryID>
<SerialNumber>5-76-9876</SerialNumber>
<UnitPrice>187.67</UnitPrice>
<ReorderLevel>5</ReorderLevel>
<LeadTime>7 Days</LeadTime>
</result>
</results>