Result Type and Attributes - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

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
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantage™

The result of a concatenation operation is a string formed by concatenating the arguments in a left-to-right direction.

Here are the default result type and attributes for arg1 || arg2:
  • If the arguments are byte strings, the result is a byte string.
  • If the arguments are numeric, character strings, or UDTs that are implicitly cast to character strings, the result is a character string.

If either argument is null, the result is null.

The data types and attributes of the arguments determine whether the result type of a concatenation operation is a fixed length or varying length string. Result types appear in the following table, where n is the sum of the lengths of all arguments:

IF this argument … Is this data type or attribute … THEN the result is this data type or attribute …
either VARBYTE VARBYTE(n)
VARCHAR VARCHAR(n)
numeric
UDT that is implicitly cast to VARCHAR
CLOB CLOB(n)
BLOB BLOB(n)
both BYTE BYTE(n)
CHARACTER (with same server character set) CHARACTER(n)
UDT that is implicitly cast to CHARACTER (with the same server character set)
CHARACTER (with different server character sets) VARCHAR(n)
UDT that is implicitly cast to CHARACTER (with different server character sets)
numeric

When either argument is a character string that specifies the CASESPECIFIC attribute, the result also specifies the CASESPECIFIC attribute.