The genxmlquery() and genxmlqueryclob() XML functions

These functions take a SQL query as a parameter and return the result set in XML.

Purpose

Use these functions to retrieve results with each column in an element.

The genxmlquery() syntax


1  genxmlquery ( row , query )

The genxmlclobelemclob() syntax


1  genxmlqueryclob ( row , query )

Parameters

row
The rows and columns to return.
query
The SQL query whose result set will be returned as XML.

Example 1

	EXECUTE FUNCTION genxmlquery('manufact_set','SELECT * FROM manufact');
<manufact_set>
<row>
  <manu_code>SMT</manu_code>
  <manu_name>Smith</manu_name>
  <lead_time>3</lead_time>
</row>
</manufact_set>