Example: Storing a Schema in a Table - 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

After defining a schema, you can store it in a table before using it for validating XML values. In this example, the schema document is stored in the table schematab, which is defined as the following:

CREATE TABLE schematab (
   schemaid VARCHAR(32),
   schemaContent XML )
   PRIMARY INDEX (schemaid);

The schema.txt file used in the following .IMPORT statement has the following format:

customerschema.xsd|customerschema.xsd

Use this statement to store the schema in the schematab table:

.IMPORT VARTEXT '|' LOBCOLS=1 FILE=schema.txt
USING (fxsd XML AS DEFERRED, xmlid varchar(32))
INSERT into schematab values(:xmlid, :fxsd);