Example: Loading Large XML Documents - 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ā„¢

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);