17.10 - Example: Concatenating Byte Strings - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)

This example shows how to concatenate byte strings. Consider the following table definition:

CREATE TABLE tsttbla
   (column_1 BYTE(2)
   ,column_2 VARBYTE(10)
   ,column_3 BLOB(128K) );

The following values are inserted into table tsttbla:

   INSERT tsttbla ('4142'XB, '7A7B7C'XB, '1A1B1C2B2C'XB);

The following SELECT statement concatenates column_2 and column_1 and column_3:

SELECT (column_2 || column_1 || column_3) (FORMAT 'X(20)')
FROM tsttbla ;

The result is:

((column_2||column_1)||column_3)
--------------------------------
7A7B7C41421A1B1C2B2C

The resulting data type is BLOB.