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

Teradata Vantageā„¢ XML Data Type

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1140-162K

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