Nonstop Database, HiRDB Version 9 Installation and Design Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
12.13 Specifying a character set
A character set is an attribute of character data. A character set has the following three attributes.
- Usage format
These are rules for representing characters. For example, in a given character set, A might be represented by the single-byte code X'41', but in another character set, it might be represented by X'C1'. These sorts of rules for character representation are called the usage format.
- Character repertoire
This is the set of characters that can be represented. For example, a given character set might allow a backslash to be represented, but another character set might not. The collection of characters that can be represented is called the character repertoire.
- Default collating sequence
These are the rules for comparing two character string data items. For example, the collating sequence might be '1' > 'A' in a given character set but 'A' > '1' in another. All character sets have default collating sequences.
The character set that is used when none is specified is called the default character set.
- Organization of this section
- (1) Effects of defining a character set
- (2) Character sets that can be used by HiRDB
- (3) Specifying a character set
- (4) Notes
(1) Effects of defining a character set
When you define a character set, character string data can be stored in a different character set for each table column. This makes it possible, if EBCDIK is specified as the character set, to retrieve, substitute, and compare character data stored in a database in the collating sequence of VOS3 system character string data when you migrate from a VOS3 system to HiRDB. Specifying UTF-16 as the character set allows retrieval, substitution, and comparison of character data in UTF-16.
(2) Character sets that can be used by HiRDB
The following character sets can be used by HiRDB.
- EBCDIK
To use EBCDIK, specify sjis as the character code type when setting up HiRDB.
- UTF16
To use UTF16, specify utf-8 or utf-8_ivs as the character code type when setting up HiRDB.
(3) Specifying a character set
Specify the character set in the character data type. For details about formats and rules that apply when specifying character sets, see the manual HiRDB Version 9 SQL Reference.
- Data cannot be loaded when the input data and the column have different character sets.
- When UTF16 is specified as the character set, the data stored in the database is big endian. When you perform an operation that uses an embedded variable or a ? parameter on a column that specifies UTF16 for its character set, make the value specified in the embedded variable or ? parameter big endian as well. If you use little endian, you need to convert the character code, which degrades performance.
All Rights Reserved. Copyright (C) 2012, 2015, Hitachi, Ltd.