If clients connect to the Teradata Database system using multiple host connections, you can assign a default character set for each HostID, by adding entries to the DBC.HostsInfoV view.
The DBC.HostsInfoV displays default character set assignments by HostID. See “Assigning Default Client Character Sets in DBC.HostsInfoV” on page 58.
Example DBC.HostsInfoV
SELECT * FROM DBC.HostsInfoV;
*** Query completed. Nine rows found. 3 columns returned.
*** Time was 2.14 seconds.
LogicalHostId HostName DefaultCharSet
------------- -------- -----------------------------
136 VM SWEDISH_EBCDIC
137 VM German_EBCDIC
138 VM Spanish_EBCDIC
139 VM French_EBCDIC
140 VM Italian_EBCDIC
141 VM Norwegian_EBCDIC
142 VM EBCDIC037_0E
1076 PC_LAN LATIN1_0A
Explanation of Example DBC.HostsInfoV
Field |
Data Type |
Comment |
LogicalHostId |
SMALLINT |
Identifies the client connection (mainframe or LAN) for which a default character set is being defined. This value must be the same as the identifier established for this connection by the hardware configuration data. For details on how to determine the value, see “Finding the LogicalHostId” on page 58. |
HostName |
VARCHAR(128) |
An arbitrary, user-assigned name for this host, for example, Mainframe1, TokyoLAN, or RetailWebsite. |
DefaultCharSet |
VARCHAR(128) |
The name of the session character set to be used by default when passing data to and from the clients in the host group. The value in this column may be: |
To assign a default character set for a host group, you must know the LogicalHostID for the group. The LogicalHostId is a 16-bit value equal to the host number + the client CPU architecture number.
You can find:
HOSTs ARRAY
_______________________
HostNo LogicalHostID Type Connected PE Range
______ _____________ ____ __________________
52 1076 COP 16379-16383
821 821 IBM 16377
829 829 IBM 16378
For details, see Utilities
SELECT hostno, logicalhostid, username FROM DBC.SESSIONINFOV;
The output is similar to:
HostNo LogicalHostId UserName
------ ------------- --------
1 2049 MRN01END
After determining the LogicalHostId of the host for which you want to specify a default character set, you can make the assignments in the DBC.HostsInfoV view.
1 Use an INSERT statement to add a row in the DBC.HostsInfoV view for each host, for example:
INS INTO DBC.HostsInfoV (1076, 'PC_LAN', 'LATIN1_0A');
where:
Syntax Element |
Description. |
1076 |
LogicalHostId |
'PC_LAN' |
Host name |
'LATIN1_0A' |
Default character set |
2 Perform a restart of the Teradata Database, using the tpareset utility, to activate the defaults.
IF the restart... |
THEN... |
successfully activates the default character sets |
the character set name and identifier for each client system are sent to the appropriate TDP during startup. |
encounters errors with a default character set |
the system defaults to this host character set: |
3 Go to /var/log/messages to check for errors associated with loading default character sets into DBC.HostsInfoV.
When the system attempts to validate the rows in DBC.HostsInfoV, if a character set in the view is not enabled, the system logs an error in the /var/adm/messages log, for example:
3133: Default Character Set is invalid.
On Fri Apr 18 10:51:05 2003 on NODE 001-01, VPROC 16383, partition 13, task disabrt
Default Character Set name: 'Portuguese_EBCDIC '
4 If the log contains any errors, correct the problems and re-run steps 2 and 3.