XML Shredding/Publishing Based on a Schema | XML Data Type | Teradata Vantage - XML Shredding Based on a Schema - 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ā„¢

XML shredding is the process of extracting values from XML documents and using them to update tables in the database. This is done based on a user-defined mapping specification that maps the XML structure to the target tables.

For example, you can perform these typical tasks to shred XML documents:

  1. Load the XML document to be shredded into an XML column of a staging table.
  2. Define an SQL query that returns a result set with 2 columns:
    • An ID column
    • The XML column that contains the XML document to be shredded
  3. Create an annotated schema that maps the XML document structure to the target tables.
  4. Store the mapping so that it can be easily referenced, for example, in a schema repository table.
  5. Call the AS_SHRED_BATCH stored procedure with the following arguments:
    • The SQL query you defined in step 2
    • The annotated schema you saved in step 4