17.10 - Adding Schema Annotations - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - XML Data Type

Advanced SQL Engine
Teradata Database
Release Number
July 2021
Last Update
Content Type
Programming Reference
Publication ID
English (United States)
Last Update

To add an annotation to an XML schema, you add an xs:annotation element with an xs:appInfo as its child element, and any application specific elements under it.

This is an example of a Context annotation that is used to explain the various elements that occur as part of the annotations:

      <context xmlFeatureVersion="1.0" xmlns="http://www.teradata.com/xml">
         <rootElement ref="_customer_item_"/>
            <operation type="insert">
               <table name="CUSTDTL">
                  <column name="ID" ref="_customerID_item_" path="Customer/@ID">
                     <sqltype name="char">
                        <constraint name="length">9</constraint>

The Context annotation is the most important annotation in the schema for defining how a document should be shredded. You add it as the first annotation under the xs:schema element in the root schema document that describes the XML documents to be shredded. The following sections describe some of the key components of the context annotation.