XMLSERIALIZE Syntax - 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
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
tkc1628112506748.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dgs1472251600184
lifecycle
latest
Product Category
Teradata Vantageā„¢
XMLSERIALIZE (
  { DOCUMENT | CONTENT } XML_value_expr
  [ AS data_type ]
  [ ENCODING XML_encoding_name ]
  [ WITH [NO] BOM ]
  [ VERSION 'char_str_literal' ]
  [ { INCLUDING | EXCLUDING } XMLDECLARATION ]
  [ NO INDENT | INDENT [ SIZE = integer ] ]
)

Syntax Elements

DOCUMENT
The XML value is an XML document node.
CONTENT
The XML value is an XQuery document node.
XML_value_expr
An instance of the XML type.
data_type
VARCHAR, CLOB, VARBYTE, or BLOB. If data_type is VARCHAR or CLOB, you can specify the character set as LATIN or UNICODE.
XML_encoding_name

An identifier for encodings such as ISO-8859-1 that are supported by Vantage.

You can specify the XML encoding specification only if the data type requested is VARBYTE or BLOB.

See Encoding Names Supported by Teradata XML.

WITH [ NO ] BOM

Whether or not a byte order mark should be added to the result.

The WITH BOM directive produces a byte order mark in these cases:
  • Target type is VARBYTE or BLOB and the encoding is a Unicode encoding (UTF-8, UTF-16, or UTF-32/UCS4)
  • Target type is VARCHAR or CLOB with the UNICODE CHARACTER SET and the client character set is UNICODE

In all other cases, the WITH BOM directive will not produce a byte order mark.

Specify the WITH BOM option only with UNICODE client character sets.

VERSION 'char_str_literal'
The XML version to which the serialization conforms. Valid values:
  • '1.0'
  • '1.1'

If not specified or if an invalid value is specified, the default is '1.0'.

INCLUDING XMLDECLARATION or EXCLUDING XMLDECLARATION
Whether or not the XML declaration (<?xml..?>) occurs at the beginning of the serialization.
NO INDENT
Specifies no indentation.
INDENT [SIZE = integer]
Specifies indentation and the amount of indentation. The default size is 4.