TRANSLATION is an ANSI/ISO SQL object created with the CREATE TRANSLATION statement. It stores a one-to-one mapping between code points in a source character set and a target character set. When a TRANSLATION exists, the database can automatically or explicitly convert string literals, column values, and parameters between those character sets during CAST, assignment, and comparison operations. This avoids data corruption when moving data between legacy encodings (for example, EBCDIC) and modern encodings (such as UTF-8). TRANSLATION objects live in the catalog, can be referenced in CAST ... USING clauses, and are dropped with DROP TRANSLATION. Support is limited; IBM Db2 implements the feature closely to the SQL standard, while most other engines rely on built-in collations or external utilities.
translation_name
(identifier) - Name of the cataloged translation object.source_character_set
(identifier) - Existing character set to translate from.target_character_set
(identifier) - Existing character set to translate to.mapping_specification
(list) - Pairs of source code points and their target equivalents. In Db2 this is supplied by the keyword LOAD FROM codepage or via a binary mapping file.CREATE CHARACTER SET, CAST, COLLATION, TRANSLATE function, UNICODE, CODE PAGE
ISO/IEC 9075:1999 (SQL:1999)
A SQL TRANSLATION is a cataloged mapping between two character sets that lets the database convert text accurately from one encoding to another.
Issue CREATE TRANSLATION name FROM IBM037 TO UTF8 WITH (mapping); list each source byte and its UTF-8 sequence. In Db2 you can also load a binary mapping file.
No. TRANSLATION is a schema object used for character-set conversion. TRANSLATE is a string function that replaces individual characters inside a string.
You must rely on built-in code-page conversions, external ETL tools, or rewrite data in a common encoding before import.