Example: How Character Set is Determined for Query - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

The character set of the expression in the first SELECT statement determines the character set of the entire query. In the following example, the character set of char_expression_1 is used as the character set for the entire query:

SELECT char_expression_1 FROM table_1
UNION
SELECT char_expression_2 FROM table_2;

If char_expression_2 contains characters not included in the character set of char_expression_1, an error can result.

For example, if char_expression_1 is CHARACTER SET LATIN but char_expression_2 is CHARACTER SET UNICODE, trying to translate char_expression_2 from UNICODE to LATIN causes an error if char_expression_2 has multibyte characters.