XMLFOREST Syntax - Analytics Database - Teradata Vantage

XML Data Type

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
tkc1628112506748.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dgs1472251600184
lifecycle
latest
Product Category
Teradata Vantageā„¢
XMLFOREST (
  [ XML_namespace_declaration , ]

  [ forest_element_spec [,...] ]

  [ OPTION
    {
      { NULL | EMPTY | ABSENT | NIL } ON NULL |
        NIL ON NO CONTENT
    }
  ]

  [ RETURNING { CONTENT | SEQUENCE } ]
)
You can include only one default namespace declaration item. It can appear in any position in the list of comma-separated namespace declarations or at the end of the list.

Syntax Elements

XML_namespace_declaration
XMLNAMESPACES (
  { 'XML_namespace_URI' AS XML_namespace_prefix |
    DEFAULT 'XML_namespace_URI' |
    NO DEFAULT
  } [,...]
)

XML namespaces that are scoped when the query expressions (row and column) are evaluated.

Namespaces declared in the prolog of the queries override any namespace declarations specified here.
forest_element_spec
forest_element_value [ AS forest_element_name ]
OPTION
NULL ON NULL
EMPTY ON NULL
ABSENT ON NULL
NIL ON NULL
NIL ON NO CONTENT
XML content options.
RETURNING CONTENT
The return value is an XQuery document node with the forest elements as its children.
RETURNING SEQUENCE
The return value is a sequence with the forest elements as items. This is the default.
'XML_namespace_URI'
The URI (Uniform Resource Identifier) that identifies the XML namespace.
XML_namespace_prefix
The namespace prefix.
forest_element_value
A value for the forest element.
forest_element_name
A name for the forest element.
If forest_element_name is specified, the name is converted to an XML name. The resulting name is a QName. forest_element_name must be a NAME such as "ELEMENTNAME".
If forest_element_name is not specified, forest_element_value must be a column reference and the column name is converted to an XML name. The resulting name is a QName. forest_element_value can be of any Teradata predefined data type or XML.
The effect of the XML content option is the same as for XMLELEMENT for each individual forest element constructed.