CHARACTER SET Phrase | Data Types and Literals | Teradata Vantage - CHARACTER SET Phrase - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantage™

Specifies the server character set for a character column.

Syntax

{ CHARACTER | CHAR } SET { LATIN | UNICODE | GRAPHIC | KANJISJIS }

ANSI Compliance

The CHARACTER SET phrase is entry-level ANSI-compliant.

Implementation-defined character sets are intermediate-level ANSI-compliant.

Using CHARACTER SET to Define Internal Storage of a Column

To define the server character set for a character column, use the CHARACTER SET phrase of a character column definition in the CREATE TABLE statement.

This optional phrase defines the internal handling of character data stored on the server and has nothing to do with the client, or session, character set.

If you omit the CHARACTER SET clause, then the default server character set for the column depends on how the user accessing the data in the table is defined in the DEFAULT CHARACTER SET clause of the CREATE USER statement. For more information, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144. If there is no default character set specified for the user, the system defaults to the character set associated with the language mode, that is, LATIN for standard language mode and UNICODE for Japanese language mode.

Supported Server Character Sets for CHARACTER SET

Teradata SQL supports five server character sets for use with CHARACTER SET. The following topics discuss each server character set in detail:

Restrictions

You cannot use the CHARACTER SET phrase for a UDT column.

Using the CHARACTER SET Phrase for Translation

The CHARACTER SET phrase is a form of explicit translation.

For information on explicit translation of CHARACTER data, see “TRANSLATE Function” in Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.

If the CHARACTER SET phrase is applied to a character expression, the expression is first translated using the implicit translation rules (see “Implicit Character-to-Character Translation” in Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145), and then truncated or extended as appropriate.

FOR this server_character_set THE n in CHAR(n) or VARCHAR(n) indicates the number of these in the translation result …
  • UNICODE
  • LATIN
  • GRAPHIC
characters
  • KANJISJIS
  • KANJI1
bytes