When data is compared, one double-byte space and two single-byte spaces are not recognized as the same data. Therefore, when blanks are represented in table data by both one double-byte space and two single-byte spaces, the retrieval results may be inaccurate.
- Example
- The following are not recognized as being the same data items:
![[Figure]](figure/zu13h010.gif)
The double-byte space character being discussed here is coded as shown below. Two single-byte space characters are coded as X'2020'.
- Shift-JIS Kanji Code: X'8140'
- EUC Japanese Kanji Code or EUC Chinese Kanji Code: X'A1A1'
- Unicode (UTF-8):# X'E38080'
- #: NCHAR and NVARCHAR cannot be used if the character codes are Unicode (UTF-8).
- Organization of this subsection
- (1) Space conversion levels
- (2) Notes
As shown in Table 13-32, three levels of space character conversion are provided by the space conversion facility.
Table 13-32 Space conversion levels
Level | Explanation |
---|
Level 0 | No space conversion. |
Level 1 | Converts as follows data spaces that occur in literals, embedded variables, and ? parameters in the data manipulation SQL and data spaces stored by utilities:
- When a character string literal is being handled as a national character string literal, two single-byte spaces in succession are converted into one double-byte space; a single occurrence of a single-byte space is not converted.
- When a character string literal is being handled as a mixed character string literal, one double-byte space is converted into two single-byte spaces.
- When data is being stored in a column of the national character type and when data is being compared with a value expression of the national character type, two single-byte spaces in succession in an embedded variable or ? parameter are converted into one double-byte space; a single occurrence of a single-byte space is not converted.
- When data is being stored in a column of the mixed character type and when data is being compared with a value expression of the mixed character type, one double-byte space in an embedded variable or ? parameter is converted into two single-byte spaces.
|
Level 3 | Adds the following processing to the processing of space conversion level 1:
- During retrieval of data of a value expression of the national character type, a single double-byte space is converted into two single-byte spaces.
|
Figure 13-85 illustrates Level 1 processing; Figure 13-86 illustrates Level 3 processing.
Figure 13-85 Level 1 processing
![[Figure]](figure/zu130050.gif)
Figure 13-86 Level 3 processing
![[Figure]](figure/zu130060.gif)