XML Type Ordering | Teradata Vantage - XML Type Cast - 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
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
tkc1628112506748.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dgs1472251600184
lifecycle
latest
Product Category
Teradata Vantageā„¢

When casting to XML type from other SQL types, an XML value of the nearest xml schema primitive type is created. For example, xs:string for VARCHAR/CLOB and xs:date for DATE.

When casting from XML type to other SQL types, the string value of the XML instance should be compatible with the target data type. For example, xs:date value being cast to SQL DATE type.

Casts to and from XML type are supported for the following data types.
  • VARCHAR
  • CLOB
  • VARBYTE
  • BLOB
  • BYTEINT
  • SMALLINT
  • INTEGER
  • BIGINT
  • DECIMAL
  • FLOAT
  • NUMBER
  • DATE
  • TIME
  • TIME WITH TIMEZONE
  • TIMESTAMP
  • TIMESTAMP WITH TIMEZONE
  • INTERVAL YEAR
  • INTERVAL YEAR TO MONTH
  • INTERVAL MONTH
  • INTERVAL DAY
  • INTERVAL DAY TO HOUR
  • INTERVAL DAY TO MINUTE
  • INTERVAL DAY TO SECOND
  • INTERVAL HOUR
  • INTERVAL HOUR TO MINUTE
  • INTERVAL HOUR TO SECOND
  • INTERVAL MINUTE
  • INTERVAL MINUTE TO SECOND
  • INTERVAL SECOND
Casting to XML type from large object types (CLOB and BLOB) is subject to a limitation that only values up to 64KB in size can be cast successfully.

When casting from XML type to VARCHAR or CLOB, only the UNICODE character set is supported for the target data type.

When casting to XML type, you can specify the inline length so that the resulting XML data type can be a LOB type or a non-LOB type.