SET CHARSET | Teradata Vantage - SET CHARSET - Teradata Vantage - Analytics Database

SQL Stored Procedures and Embedded SQL

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
frc1628111662093.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
rjx1472253414573
lifecycle
latest
Product Category
Teradata Vantage™

Specifies a character set to be used for translation of data to and from the database at program execution.

ANSI Compliance

SET CHARSET is a Teradata extension to the ANSI/ISO SQL:2011 standard.

Required Privileges

None.

Invocation

Executable.

Embedded SQL only.

Syntax

SET CHARSET { character_set_name | :character_set_name_variable }

Syntax Elements

character_set_name
The character set to be used in translating data between the client and the database.
:character_set_name_variable
A host variable that contains the name of the character set to be used in translating data between the client and the database.
Use of the colon character is mandatory.
For information on UTF-8 and UTF-16 character sets and specific UTF-8 and UFT-16 programming considerations or about :character_set_name_variable, see Teradata® Preprocessor2 for Embedded SQL Programmer Guide, B035-2446.

Usage Notes

  • SET CHARSET overrides the default character set used for communication between the application and the database at runtime.
  • Whether specified as character_set_name or as :character_set_name_variable, the character set name must be a valid character set identifier.
  • If used to identify the character set name rather than the character set code, character_set_name must be enclosed in apostrophes, based on the APOST/QUOTE preprocessor option setting.
  • If used to identify the character set name, :character_set_name_variable must follow the rules for SQL strings for the client language.
  • If used to identify the character set code, :character_set_name_variable must be defined as a small integer host variable.
  • Specification of the SET CHARSET statement does not affect preprocessor processing, just the data sent and retrieved from the database at execution time.