Example: Using CREATESCHEMABASEDXML to Create a Schema-validated and Type-annotated XML Value

Teradata Vantageā„¢ XML Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1140-162K

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;