Example: Concatenating Byte Strings - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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.