16.20 - Example: Loading Large XML Documents - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ XML Data Type

Teradata Database
Teradata Vantage NewSQL Engine
Release Number
Release Date
March 2019
Content Type
Programming Reference
Publication ID
English (United States)

The following shows how you can use the LOB support in BTEQ to load large documents.

In this example, you have a file called custdocs.txt with the following content:

Cust001.xml|1|John Hancock

Cust001.xml is an XML document on the client file system. You can use this .IMPORT statement to load the Cust001.xml document into the customer table:

.IMPORT VARTEXT '|' LOBCOLS=1 FILE='custdocs.txt'
USING (custdoc XML AS DEFERRED, custid VARCHAR(256), custname VARCHAR(256))
INSERT INTO customer(CAST(:custid AS INTEGER), :custname, :custdoc);