17.10 - Example: Using CREATESCHEMABASEDXML to Create a Schema-validated and Type-annotated XML Value - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - XML Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Last Update
2021-07-28
Content Type
Programming Reference
Publication ID
B035-1140-171K
Language
English (United States)
Last Update
2021-07-28

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;