Example: Using CREATESCHEMABASEDXML to Create a Schema-validated and Type-annotated XML Value - 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ā„¢

These statements perform a validating parse on the XML document in the customerXML column using the schema with schemaid customerschema.xsd. If the document is valid, the fast infoset representation of the document is updated with type information.

UPDATE customer
SET customerXML = customerXML.CREATESCHEMABASEDXML(
(SELECT schemacontent FROM schematab WHERE schematab.schemaid='customerschema.xsd'))
WHERE customerID = 1;