Reference Guide > TDV Support for SQL Functions > TDV-Supported XML Functions > XMLNAMESPACES
 
XMLNAMESPACES
XMLNAMESPACES constructs namespace declarations from the arguments provided. Namespaces provide a way to distinguish names used in XML documents.
A namespace declaration can only be used as an argument for specific functions such as XMLELEMENT and XMLFOREST. The result is one or more XML namespace declarations containing in-scope namespaces for each non-NULL input value.
Example
SELECT CustomerID, XMLELEMENT (NAME customerName,
XMLNAMESPACES ('http://localhost:9400/services/webservices/ws/TestService/TestPort' AS "customers"), XMLATTRIBUTES (City AS city, ContactLastName as name)) "Customer Details"
FROM /services/webservices/ws/TestService/TestPort/customers
WHERE StateOrProvince = 'CA'