Example: Validating an XML Document - 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ā„¢

In this query, the ISSCHEMAVALID method is used to validate the XML document in the customer table using the schema stored in the schematab table.

SELECT customerID, customerXML.ISSCHEMAVALID(schematab.schemaContent, 'Customer', '')
FROM customer, schematab
WHERE schematab.schemaid = 'customerschema.xsd';

The result of the query is:

customerID  customerXML.ISSCHEMAVALID(schemaContent, 'Customer', '')
-----------  --------------------------------------------------------
          1                                                         1

The ISSCHEMAVALID method returned a value of 1 indicating that the XML document is valid based on the schema.