Example: Using XMLSERIALIZE to Serialize an XML Value to a CLOB Value - Advanced SQL Engine - Teradata Database

XML Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
kxe1590704060061.ditamap
dita:ditavalPath
kxe1590704060061.ditaval
dita:id
B035-1140
lifecycle
previous
Product Category
Teradata Vantage™
SELECT XMLSERIALIZE(DOCUMENT customerXML AS CLOB CHARACTER SET UNICODE
   WITH BOM INCLUDING XMLDECLARATION)
FROM customer
WHERE customerID = 1;

Here are partial results from the query. The ellipsis (...) is not part of the query results. It indicates that the query returns additional results that are truncated in the example.

XMLSERIALIZE(DOCUMENT customerXML AS CLOB(2097088000) CHARACTER ...
-----------------------------------------------------------------------
 <?xml version="1.0" encoding="UTF-8" ?> <Customer>  <Name>John Hancock</Name>  <Address>100 1st Street, San Francisco, CA 94118</Address>  <Phone1>(858)555-1234</Phone1>  <Phone2>(858)555-9876</Phone> ...