Example: Loading Large XML Documents - Advanced SQL Engine - Teradata Database

XML Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
amr1556233250442.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1140
lifecycle
previous
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);