XMLSERIALIZE Syntax - 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ā„¢
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.