MacroCharSet - Parallel Transporter

Teradata Parallel Transporter Reference

Product
Parallel Transporter
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2436
lifecycle
previous
Product Category
Teradata Tools and Utilities

MacroCharSet

The MacroCharSet option only applies to the Stream operator.

The MacroCharSet option specifies the server storage character set name for the character field in the schema. The Stream operator uses the server storage character set name to generate a CHARACTER SET clause for each character field when creating the macros. The Stream operator creates a macro for each DML statement specified in the job. The correct server storage character set is required to avoid character set translation errors.

There are two ways to define the server storage character set name:

  • Specify the field-level MACROCHARSET (<field‑server-character‑set>) clause after the declaration of a character column in the DEFINE SCHEMA statement.
  • If a field-level MACROCHARSET (<field‑server‑character‑set>) clause is specified for a given character field in the schema, the field server character set will be used for the given character field.

  • Specify the global-level DEFAULT MACROCHARSET (<global‑server‑character‑set>) clause in the DEFINE SCHEMA statement.
  • If the global-level DEFAULT MACROCHARSET (<global‑server‑character‑set>) clause is specified, the global server character set will be used for each character field that has no field-level MACROCHARSET clause in the schema.

    If the global-level DEFAULT MACROCHARSET (<global‑server‑character‑set>) is not specified, the server storage character set will be LATIN or UNICODE (depending on the client session character set) for each character field that has no field-level MACROCHARSET clause in the schema.

    It will be LATIN if the client session character set name:

  • Is ASCII
  • Is EBCDIC
  • Ends in _0A or _0E
  • Ends in _zx, where "z" is other than 0 (digit zero)
  • Does not end in _zx or _zxx, except for KATAKANAEBCDIC, UTF-8, or UTF-16
  • It will be UNICODE in all other client session character sets.

    When you are loading to character columns with different server storage character sets, it is recommended to use the field-level MACROCHARSET (<field‑server‑character‑set>) clause. For example, you are loading data to a target table using a Japanese client session character set with the following table definition: EMP_ID INTEGER, EMP_NAME VARCHAR(40) CHARACTER SET UNICODE, EMP_SEX CHAR(1) CHARACTER SET LATIN.

    To specify the field-level MACROCHARSET clause:

    DEFINE SCHEMA EMP_SCHEMA
     (
       EMP_ID   INTEGER,
       EMP_NAME VARCHAR(40) MACROCHARSET (UNICODE),
       EMP_SEX  CHAR(1) MACROCHARSET (LATIN)
    ­);

    The job will terminate with an error if you specify:

  • A field‑level MACROCHARSET (<field‑server‑character‑set>) clause on a non-character column.
  • An invalid server storage character set. The job will terminate with "RDBMS error 3706: Syntax error: Expected Character Data Type."
  • For the server storage character set names, refer to the Teradata Database International Character Set Support.