Document Retrieval - Advanced SQL Engine - Teradata Database

XML Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
amr1556233250442.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1140
lifecycle
previous
Product Category
Teradata Vantageā„¢

The following sections show how users can store XML documents into XML type columns and retrieve them via SQL queries that either retrieve the entire document or evaluate an XPath/XQuery expression that returns a single document node.

Consider the following queries:
SELECT id, xmldoc FROM xmltab;
SELECT id, xmldoc.xmlextract('.', NULL) FROM xmltab;

The result of each query represents a single tree rooted in a document node. In this case, the server returns the serialized representation of the document. The serialization of the document is not guaranteed to be lexically equivalent to the document that was inserted, but it will be semantically equivalent (the canonical representation of the original document that was inserted and the document retrieved will be lexically equivalent). Drivers can either parse the document returned or pass on the stream to applications.