15.10 - Enabling a Custom Client Character Set - Teradata Database

Teradata Database International Character Set Support

prodname
Teradata Database
vrm_release
15.00
15.10
category
Configuration
User Guide
featnum
B035-1125-015K

You perform the following setup tasks, using the DBC.CharTranslationsV view, to enable a client character set:

1 “Loading a Custom Client Character Set” on page 76.

2 “Activating a Client Character Set” on page 79

To be available for use, character sets must be listed in the DBC.CharTranslationsV view.

All Teradata-supplied client character sets are listed by default in the DBC.CharTranslationsV, except the four defaults, ASCII, EBCDIC, UTF8 and UTF16.

Example DBC.CharTranslationsV

Note: The example that follows shows only the first 4 of 8 columns. The last 4 columns are translation codes similar to the E2I column. For details, see the explanation table that follows the example.

   SELECT * FROM DBC.CharTranslationsV;
   *** Query completed. 29 rows found. 7 columns returned. 
   *** Time was 3.60 seconds.
   CharSetName         CharSetId  InstallFlag E2I 
   ---------------     ---------  ----------- -------------------
   KATAKANAEBCDIC      111        N           000102039409967F.. 
   SCHINESE936_6R0     115        N           0001020304050607..
   HANGULKSC5601_2R4   120        N           0001020304050607..
   EBCDIC273_0E         97        N           000102039C09867F..
   EBCDIC037_0E         96        N           000102039C09867F.. 
   KANJIEBCDIC5035_0I  113        N           000102039C09867F.. 
   LATIN1_0A           126        N           0001020304050607..
   TCHEBCDIC937_3IB    110        N           0001020304050607.. 
   KANJISJIS_0S        119        N           0001020304050607..
   LATIN1252_3A0       123        N           0001020304050607..
   KANJIEBCDIC5026_0I  112        N           000102039C09867F..
   HEBREW1255_5A0      103        N           0001020304050607..
   ARABIC1256_6A0      104        N           0001020304050607.. 
   KANJIEUC_0U         118        N           0001020304050607..
   LATIN9_0A           125        N           0001020304050607..
   CYRILLIC1251_2A0    102        N           0001020304050607.. 
   THAI874_4A0         100        N           0001020304050607..
   LATIN1250_1A0       101        N           0001020304050607..
   HANGUL949_7R0       116        N           0001020304050607..
   SCHGB2312_1T0       121        N           0001020304050607..
   LATIN1254_7A0       105        N           0001020304050607..
   SCHEBCDIC935_2IJ    109        N           0001020304050607..
   TCHINESE950_8R0     117        N           0001020304050607.. 
   HANGULEBCDIC933_1II 108        N           0001020304050607..
   EBCDIC277_0E         98        N           000102039C09867F..
   LATIN1258_8A0       106        N           0001020304050607..
   LATIN1252_0A        124        N           0001020304050607..
   TCHBIG5_1R0         122        N           0001020304050607..
   KANJI932_1S0        114        N           0001020304050607..

Explanation of Example

 

Field

Attributes

Description

CharSetName (TranslateName)

VARCHAR(128) NOT NULL

A name that uniquely identifies a character set.

Japanese character set names should start with an unaccented uppercase Roman letter and consist of only unaccented uppercase Roman letters, digits, underscore, dollar sign, or number sign.

CharSetID (TranslateID)

BYTEINT NOT NULL

A number that uniquely identifies the character set for which these translation codes are being inserted. The number must be in the range 65–126.

InstallFlag (Install)

CHAR(1) NOT NULL

A value of either Y or N, where:

  • Y= Enable the codes for the CharSetName at the next restart of the Teradata Database.
  • N=The codes for the CharSetName are disabled.
  • A maximum of 16 character sets can be enabled at one time.

    If more than 16 rows are flagged as Y at reset time, the system sorts CharSetName values in ascending ASCII sequence and enables the rows in alphabetical order until the 16 set limit is reached.

    E2I (TranslateIn)

    BYTE(256) NOT NULL

    The external (host)-to-internal (Teradata Database) codes for each character in the set being defined.

    E2IUp (TranslateInUp)

    BYTE(256) NOT NULL

    The external-to-internal uppercase codes for each character in the set being defined.

    I2E (TranslateOut)

    BYTE(256) NOT NULL

    The internal (Teradata Database)-to-external (client) codes for each character in the set being defined.

    I2EUp (TranslateOutUp)

    BYTE(256) NOT NULL

    The internal-to-external uppercase codes for each character in the set being defined.

    For more information on DBC.CharTranslationsV, see Data Dictionary.

    You must load a character set before you can activate it for use.

    1 Log on to the Teradata Database as a user with INSERT privileges on database DBC.

    2 Use the INSERT statement to load each needed character set into the DBC.CharTranslationsV view, using a BTEQ batch file or other method.

    Ensure that the client configuration matches the translation entry and table just created.

    Note: There is no limit on the number of character sets you can load onto your system, but no more than 16 character sets can be active at a time.

    Example Load Script

    This example shows a BTEQ batch job used to insert a row defining the translation codes for a Finnish/Swedish character set. The external hexadecimal codes are EBCDIC and agree with Character Sequence Number 24 for an IBM 3270 Control Unit displaying to an IBM 3270 Information Display System.

    /*****************************************************************/
    /* This is the Finnish/Swedish Character Set Codes for IBM 3270  */
    /* information display system. The IBM manuals title “IBM 3270   */
    /* Information Display System. 3270 Control Unit“ and “IBM 3270  */
    /* Information Display System. Character Set Reference“.         */
    /* Document numbers GA23-0065-6 and GA27-2837-9 correspondingly. */
    /* The sequence number for this character set is 24 - see 2-55   */
    /* of GA23-0065-6 and 10-17 and 10-45 of GA27-2837-9. Here is    */
    /* the map between DBC and IBM character codes:                  */
    /*                                                               */
    /*     Character Name                       DBC   IBM            */
    /*                                          HEX   HEX            */
    /*                                                               */
    /*     Lowercase a with umlaut (diaresis)...E4    C0             */
    /*     Uppercase A with umlaut (diaresis)...C4    7B             */
    /*     Lowercase a with ring................E5    D0             */
    /*     Uppercase A with ring................C5    5B             */
    /*     Lowercase e with acute accent........E9    79             */
    /*     Uppercase E with acute accent........C9    E0             */
    /*     Lowercase o with umlaut (diaresis)...F6    05             */
    /*     Uppercase O with umlaut (diaresis)...D6    7C             */
    /*     Lowercase u with umlaut (diaresis)...FC    A1             */
    /*****************************************************************/
     
    INSERT INTO DBC.CharTranslationsV 
    ( CharSetName
    , CharSetId 
    , InstallFlag 
    , E2I
    , E2IUp
    , I2E
    , I2EUp )
    VALUES
    ( ’SWEDISH_EBCDIC’
    , 71   
    , ’Y’
    /* TranslateIn.  External -> Internal      */
    /* 0 1 2 3 4 5 6 7 8 9 A B C D E F         */
    , ’00010203A8F6A97FD1D2D30B0C0D0E0F’xb/* 0 */
    ||’10111213D4D508401819D7D81C1D1E1F’xb/* 1 */
    ||’7DE6D9E7E80A171B60F0F1F2F3050607’xb/* 2 */
    ||’F4F51609F75CF804F9E2E37B1415E01A’xb/* 3 */
    ||’208182838485868788898B2E3C282B8D’xb/* 4 */
    ||’2691929394959697989921C52A293B5E’xb/* 5 */
    ||’2D2F9B9DA2A3A4A5A6A77C2C255F3E3F’xb/* 6 */
    ||’C1C2C32324C6C7C87EE93AC4D6273D22’xb/* 7 */
    ||’806162636465666768698AC08CAD8E8F’xb/* 8 */
    ||’906A6B6C6D6E6F7071729AD09CBD9E9F’xb/* 9 */
    ||’A0FC737475767778797AAAABAC5BAEAF’xb/* A */
    ||’B0B1B2B3B4B5B6B7B8B9BABBBC5DBEBF’xb/* B */
    ||’E4414243444546474849CACBCCCDCECF’xb/* C */
    ||’E54A4B4C4D4E4F505152DADBDCDDDEDF’xb/* D */
    ||’C9E1535455565758595AEAEBECEDEEEF’xb/* E */
    ||’30313233343536373839FAFBA1FDFEFF’xb/* F */
    /* TranslateInUp.  External -> Internal    */
    /* 0 1 2 3 4 5 6 7 8 9 A B C D E F         */
    , ’00010203A8D6A97FD1D2D30B0C0D0E0F’xb/* 0 */
    ||’10111213D4D508401819D7D81C1D1E1F’xb/* 1 */
    ||’7DE6D9E7E80A171B60F0F1F2F3050607’xb/* 2 */
    ||’F4F51609F75CF804F9E2E37B1415E01A’xb/* 3 */
    ||’208182838485868788898B2E3C282B8D’xb/* 4 */
    ||’2691929394959697989921C52A293B5E’xb/* 5 */
    ||’2D2F9B9DA2A3A4A5A6A77C2C255F3E3F’xb/* 6 */
    ||’C1C2C32324C6C7C87EC93AC4D6273D22’xb/* 7 */
    ||’804142434445464748498AC08CAD8E8F’xb/* 8 */
    ||’904A4B4C4D4E4F5051529AD09CBD9E9F’xb/* 9 */
    ||’A0FC535455565758595AAAABAC5BAEAF’xb/* A */
    ||’B0B1B2B3B4B5B6B7B8B9BABBBC5DBEBF’xb/* B */
    ||’C4414243444546474849CACBCCCDCECF’xb/* C */
    ||’C54A4B4C4D4E4F505152DADBDCDDDEDF’xb/* D */
    ||’C9E1535455565758595AEAEBECEDEEEF’xb/* E */
    ||’30313233343536373839FAFBA1FDFEFF’xb/* F */
    /* TranslateOut. Internal -> External      */
    /* 0 1 2 3 4 5 6 7 8 9 A B C D E F         */
    , ’00010203372D2E2F1633250B0C0D0E0F’xb/* 0 */
    ||’101112133C3D322618193F271C1D1E1F’xb/* 1 */
    ||’405A7F73746C507D4D5D5C4E6B604B61’xb/* 2 */
    ||’F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F’xb/* 3 */
    ||’17C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6’xb/* 4 */
    ||’D7D8D9E2E3E4E5E6E7E8E9AD35BD5F6D’xb/* 5 */
    ||’28818283848586878889919293949596’xb/* 6 */
    ||’979899A2A3A4A5A6A7A8A93B6A207807’xb/* 7 */
    ||’804142434445464748498A4A8C4F8E8F’xb/* 8 */
    ||’905152535455565758599A629C639E9F’xb/* 9 */
    ||’A0FC6465666768690406AAABAC8DAEAF’xb/* A */
    ||’B0B1B2B3B4B5B6B7B8B9BABBBC9DBEBF’xb/* B */
    ||’8B7071727B5B757677E0CACBCCCDCECF’xb/* C */
    ||’9B08090A14157C1A1B22DADBDCDDDEDF’xb/* D */
    ||’3EE1393AC0D021232479EAEBECEDEEEF’xb/* E */
    ||’292A2B2C303105343638FAFBA1FDFEFF’xb/* F */
    /* TranslateOutUp. Internal -> External    */
    /* 0 1 2 3 4 5 6 7 8 9 A B C D E F         */
    , ’00010203372D2E2F1633250B0C0D0E0F’xb/* 0 */
    ||’101112133C3D322618193F271C1D1E1F’xb/* 1 */
    ||’405A7F73746C507D4D5D5C4E6B604B61’xb/* 2 */
    ||’F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F’xb/* 3 */
    ||’17C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6’xb/* 4 */
    ||’D7D8D9E2E3E4E5E6E7E8E9AD35BD5F6D’xb/* 5 */
    ||’28C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6’xb/* 6 */
    ||’D7D8D9E2E3E4E5E6E7E8E93B6A207807’xb/* 7 */
    ||’804142434445464748498A4A8C4F8E8F’xb/* 8 */
    ||’905152535455565758599A629C639E9F’xb/* 9 */
    ||’A0FC6465666768690406AAABAC8DAEAF’xb/* A */
    ||’B0B1B2B3B4B5B6B7B8B9BABBBC9DBEBF’xb/* B */
    ||’8B7071727B5B757677E0CACBCCCDCECF’xb/* C */
    ||’9B08090A14157C1A1B22DADBDCDDDEDF’xb/* D */
    ||’3EE1393A7B5B212324E0EAEBECEDEEEF’xb/* E */
    ||’292A2B2C30317C343638FAFBA1FDFEFF’xb/* F */
    );

    After loading the needed character sets into the DBC.CharTranslationsV view, you must activate the character set.

    1 Set the InstallFlag column to Y for the character set you want to activate. The limit is 16 active character sets.

    UPDATE DBC.CharTranslationsV SET InstallFlag=’Y’ WHERE CharSetId = custom_characterset_id;

    or

    UPDATE DBC.CharTranslationsV SET InstallFlag=’Y’ WHERE CharSetName = ‘custom_characterset_name’;

    2 Perform a full restart of Teradata Database, using the tpareset utility. For usage information, see tpareset in Utilities.