Example: Validating an XML Document - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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.