Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Teradata RDBMS forUNIX SQL Reference - NCR

NCR Teradata RDBMS forUNIX SQL Reference - NCR, 1997. - 913 p.
Download (direct link): teradataforunix1997.pdf
Previous << 1 .. 215 216 217 218 219 220 < 221 > 222 223 224 225 226 227 .. 241 >> Next


G-26

Teradata RDBMS for UNIX SQL Reference
International and Japanese Character Support

Using Collation Sequences

Using Collation Sequences

Collation sequence controls character ordering and comparison IntrOductiOn operations during Teradata sessions.

The collation in effect for a session can be set with the COLLATION parameter of the Teradata SQL CREATE USER and MODIFY USER statements, and the BTEQ .SET SESSION command.

Teradata offers three standard collation sequences: ASCII (based on the ANSI-standard), EBCDIC, and MULTINATIONAL:

These collation sequences are always available. If the COLLATION ascII and ebcdIc parameter is not defined, the default is HOST (the collation that is

compatible with the logon client).

The default HOST collation is EBCDIC for an IBM channel-attached host, and ASCII for any other configuration.

The collation sequence for MULTINATIONAL collation can be one multInatIonal of the following:

• Teradata Standard Multinational (a two-level comparison based on the collation order of European dictionaries)

This is the initial default sequence for any user or session with [SESSION] COLLATION set to MULTINATIONAL. It is created by macro, CollAddStandard, executed when the “dip” files are run during Teradata RDBMS installation.

• Norwegian Standard (based on the Norwegian collation sequence)

• Swedish Standard (based on the Swedish collation sequence)

• Any one of three predefined Japanese collations.

• A collation sequence that you define

MULTINATIONAL collation is two level for international characters support and single level for Japanese character support. Note that Teradata, Norwegian, and Swedish standard collations are designed as two level and that the Japanese collations are designed as single level.

Using these collations when the number of levels does not match the designed number may not produce useful results. Also note that only single byte characters are amenable to user defined collations.

Teradata RDBMS for UNIX SQL Reference

G-27
International and Japanese Character Support

Using Collation Sequences

Two-Level Collations: Teradata Standard Multinational

Multibyte collation is designed to handle KanjiEBCDIC style (shift-in, Shift-out) delineating multibyte characters.

For a full explanation of Teradata RDBMS collating conventions, refer to:

• Chapter 6, “SQL Expressions,” under “Logical Expressions:

• Comparison Operators”

• “Kanji Site Comparison Operators”

• Chapter 8, under the ORDER BY Clause of the SELECT statement, “Usage Notes”.

For International character support, MULTINATIONAL collation orders character strings according to the “two-level comparison”:

Characters are first partitioned into equivalence classes that have the same collation value. If two or more characters fall within the same class, further ordering is based on case-specific and uppercase comparisons.

Thus, the comparison of two character strings obeys the following rules:

1 All characters in an equivalent class have the same collation value. A character from class “i” is less then any character from class “i+1”

2 If two strings are equal, additional processing takes place which orders the characters within a class.

Example

As an example using Teradata Standard Multinational collation, consider the following characters: b, B, c, C, 5, Q, d and D.

The Teradata Standard Multinational collation considers the:

• characters b and B to be in the equivalence class of B;

• characters c, C, 5, and Q to be in the equivalence class of C;

• characters d and D to be in the equivalence class of D.

Within the equivalence class of B, the case-specific ordering is first b and then B.

Within the equivalence class of C, the case-specific ordering is first c, then C, 5, and Q.

Within the equivalence class of D, the case-specific ordering is d, D.

Table G- 1 shows the internal values of the characters b, B, c, C, 5, Q, d and D, and their corresponding values in CollEqvClass, CollOrderCS, and CollOrderUC.

G-28

Teradata RDBMS for UNIX SQL Reference
International and Japanese Character Support

Using Collation Sequences

Table G- 1

Equivalence Classes and Ordering Within Class (Teradata Standard Multinational Collation)

Single Level Collations: Japanese Language

Tools for Collation Control

In this table that the values assigned to the equivalence class of b, c, and d are 0x62, 0x63, and 0x64, respectively. This assures that b sorts before c, and c before d. The case-specific (CollOrderCS) value for c is 0x00, and the case-specific value for C is 0x01. This assures that, using the second-level comparison, c sorts before C.

For a complete discussion of ordering characters within classes as performed by the Teradata Standard Multinational collation, see the ORDER BY clause of the “SELECT” statement, in Chapter 7.

Character Internal Value (hex) CollEqv Class (hex) CollOrder Case Specific (hex) CollOrder Uppercase (hex)
Previous << 1 .. 215 216 217 218 219 220 < 221 > 222 223 224 225 226 227 .. 241 >> Next