Example: XQuery/XPath Query Returns a Sequence of xs:integer or xs:double Values - Teradata Vantage NewSQL Engine - 16.20

Teradata Vantageā„¢ XML Data Type

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1140-162K
This query returns a sequence of xs:integer or xs:double values depending on the value of the total element in the XML document:
SELECT CAST(XMLQUERY('for $cust in /customers/customer return sum(order/total)' passing
xmldoc) AS VARCHAR(512))
AS ordertotals
FROM xmltab;
The result of this query is the following string value of type VARCHAR (XQuery cast of each item to xs:string, separated by a single white space character):
2496.50 1383.50