Result Type and Attributes - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
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.