16.20 - Example: Concatenating Byte Strings - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Functions, Expressions, and Predicates

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

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.