XMLTABLE

Teradata Vantageā„¢ XML Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1140-162K

Purpose

Converts an XML tree structure to a row set.

Syntax





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.




XML namespace declaration

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.
'XML_namespace_URI'
The URI (Uniform Resource Identifier) that identifies the XML namespace.
XML_namespace_prefix
The namespace prefix.
'XML_tab_row_pattern'
A valid XQuery expression supplied as a character string literal. One row is generated for each item in the result of this query.
XML query argument
An argument or list of arguments for the row pattern query.
BY VALUE
Row pattern query arguments are passed in by value. This is the default.
XML_query_content_item

A value expression representing an XML query context item.

You can pass in only one context item.

XML_query_variable AS variable_name

An XML query variable in the format:

value_expression AS identifier
COLUMNS

The columns in the table returned by the function.

If not specified, the function returns a single column, named COLUMN_VALUE, which contains XML typed values resulting from the evaluation of the row pattern query.

column_name
The name of a column in the output table.
FOR ORDINALITY
The column contains an integer that represents a sequence number for the rows generated, starting with 1 for the first row.
data_type
The data type of a column in the output table.
PATH 'char_str_literal'
The XML table column pattern, a query that returns the column value. This query is evaluated relative to the item returned by the row query; that is, it uses the item returned by the row query as the context item. The resulting value is cast to the column data type.
default_clause

The default value for the column if the column query returns no results.

The default clause is not applicable for certain data types such as CLOB, BLOB, and UDTs.