XMLEXTRACT 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ā„¢
XMLEXTRACT (
  [ filterExpr, ]
  query,
  nsmap
)

Syntax Elements

filterExpr
An optional filter expression that allows for streamed evaluation of the query expression.
filterExpr is required if the query is being evaluated over a large XML value.
filterExpr must be VARCHAR(n), where the maximum supported size (n) is 512.
query
The XPath or XQuery query string.
query must be VARCHAR(n), where the maximum supported size (n) is 8192.
nsmap
Namespace declarations.
nsmap must be VARCHAR(n), where the maximum supported size (n) is 1024.
You can declare namespaces in two ways:
  • Declare the namespaces in the query string. For example:
    SELECT CREATEXML('<a xmlns="http://td.com"><b>c</b><b>d</b></a>').XMLEXTRACT('declare namespace td = "http://td.com"; /td:a/td:b', NULL);

    The namespace is declared at the beginning of the query: declare namespace td = "http://td.com"

  • Specify the namespaces in the nsmap parameter as a string of prefix=namespace_uri declarations with a space separating each namespace declaration. For example:
    SELECT CREATEXML('<a xmlns="http://td.com"><b>c</b><b>d</b></a>').XMLEXTRACT('/td:a/td:b', 'td=http://td.com');