16.20 - Example: Using CREATESCHEMABASEDXML to Create a Schema-validated and Type-annotated XML Value - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ XML Data Type

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1140-162K
Language
English (United States)

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;