Establishing the Character Set - Basic Teradata Query

Basic Teradata Query Reference

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

To establish a character set, you can do any of the following:

  • Establish a character set that is in effect for a BTEQ job.
  • Override the default character set.
  • Switch between multi-byte and English modes.
  • The character set is preserved for the duration of the session (until a QUIT), not just for the logon.

    You can establish a character set in one of the following ways:

  • Specify the character set with the BTEQ SESSION CHARSET command.
  • You do not need to issue the command when you log on to BTEQ. Issue the command before you run the operation that needs to be in a particular character set. This user‑specified character set will override all other character sets previously specified or placed in default.

    For example:

       .SET SESSION CHARSET 'KANJIEBCDIC5035_0I'

    At logon, for example, if the logon string is normally in the form:

       BTEQ .LOGON tdpid/user,password

    you could modify it to use KanjiEBCDIC as follows:

       BTEQ .SET SESSION CHARSET 'EBCDIC';
       .LOGON tdpid/user,password

    Note: The .SET string must precede the .LOGON string.

  • Specify a character set value in:
  • The HSHSPB parameter module for IBM mainframes
  • The clispb.dat file for UNIX platforms
  • This takes second precedence.

  • If a character set has not been user‑specified or specified in HSHSPB or clispb.dat, then the default is the value in the system table, DBC.Hosts.
  • If an application relies on the DBC.Hosts table for the default character set name, you must ensure that the initial logon from the mainframe-attached side is in KanjiEBCDIC; otherwise, the default character set cannot be known to the application before logon.