NLS General Connection Attributes

The National Language Support (NLS) connection attributes set the default length semantics configuration, determine whether an error caused by data loss is reported, and what collating sequence for linguistic comparisons should be used.

These attributes are set by each connection and persist for the duration of the connection, but you can use the ALTER SESSION statement, described in Oracle TimesTen In-Memory Database SQL Reference, to change NLS parameters to override the values that are assigned to these attributes at connection time.

The NLS general connection attributes are described in detail next.

ConnectionCharacterSet

Specifies the character encoding for the connection and it is also available as a Client connection attribute.

The character encoding for the connection can be different from the database character set. This can be useful when you have multiple connections to a database and one or more of those connections requires a character set that differs from that specified in the database.

The connection character set determines the character set in which data is displayed or presented.

Generally, you should choose a connection character set that matches your terminal settings or data source. Your database character set should be chosen based on the data requirements. For example: Do you have data in Unicode or is your data in Japanese on UNIX or Linux (EUC) or Windows (SJIS)?

When the database and connection character sets differ, TimesTen performs data conversion internally based on the connection character set. If the connection and database character sets are the same, TimesTen does not need to convert or interpret the data set. Best performance occurs when connection and database character sets match, since no conversion is required.

Parameters and SQL query text sent to the connect should be in the connection character set. Results and error messages returned by the connection are returned in the connection character set.

This attribute accepts the same values used for the DatabaseCharacterSet. For a list of supported character set names, see Supported Character Sets.

Required Privilege

No privilege is required to change the value of this attribute.

Usage in TimesTen Scaleout and TimesTen Classic

This attribute is supported in both TimesTen Classic and TimesTen Scaleout.

Setting

Set ConnectionCharacterSet as follows:

Where to set the attribute How the attribute is represented Setting

C or Java programs or UNIX and Linux systems odbc.ini file in TimesTen Classic or in the database definition (.dbdef) file in TimesTen Scaleout

ConnectionCharacterSet

The default value for ConnectionCharacterSet is US7ASCII.

Windows ODBC Data Source Administrator

Connection CharacterSet list field on the Oracle TimesTen Client DSN Setup dialog

The default value for ConnectionCharacterSet is US7ASCII.

NLS_LENGTH_SEMANTICS

TimesTen uses the NLS_LENGTH_SEMANTICS attribute to set the default length semantics configuration.

Length semantics determines how the length of a character string is determined. The length can be treated as a sequence of characters or a sequence of bytes.

NLS_LENGTH_SEMANTICS can be modified by an ALTER SESSION SQL statement, described in Oracle TimesTen In-Memory Database SQL Reference .

Required Privilege

No privilege is required to change the value of this attribute.

Usage in TimesTen Scaleout and TimesTen Classic

This attribute is supported in both TimesTen Classic and TimesTen Scaleout.

Setting

Set NLS_LENGTH_SEMANTICS as follows:

Where to set the attribute How the attribute is represented Setting

C or Java programs or UNIX and Linux systems odbc.ini file in TimesTen Classic or in the database definition (.dbdef) file in TimesTen Scaleout

NLS_LENGTH_ SEMANTICS

Specify either BYTE (default) or CHAR.

Windows ODBC Data Source Administrator

Not applicable

NLS_NCHAR_CONV_EXCP

The NLS_NCHAR_CONV_EXCP attribute determines whether an error is reported when there is data loss during an implicit or explicit character type conversion between NCHAR/NVARCHAR2 data and CHAR/VARCHAR2 data.

A replacement character is substituted for characters that cannot be converted, and implicit and explicit conversions between CHAR and NCHAR are supported.

NLS_NCHAR_CONV_EXCP can be modified by an ALTER SESSION SQL statement, described in Oracle TimesTen In-Memory Database SQL Reference.

Required Privilege

No privilege is required to change the value of this attribute.

Usage in TimesTen Scaleout and TimesTen Classic

This attribute is supported in both TimesTen Classic and TimesTen Scaleout.

Setting

Set NLS_NCHAR_CONV_EXCP as follows:

Where to Set the Attribute How the Attribute is Represented Setting

C or Java programs or UNIX and Linux systems odbc.ini file in TimesTen Classic or in the database definition (.dbdef) file in TimesTen Scaleout

NLS_NCHAR_CONV_EXCP

0 (default) - Errors are not reported when there is a data loss during character type conversion.

1 - Errors are reported when there is a data loss during character type conversion.

Windows ODBC Data Source Administrator

Not applicable

NLS_SORT

The NLS_SORT attribute indicates which collating sequence to use for linguistic comparisons.

It accepts the monolingual and multilingual values from the Supported Linguistic Sorts tables. All these values can be modified to do case-insensitive sorts by appending _CI to the value. To perform accent-insensitive and case-insensitive sorts, append _AI to the value.

For materialized views and cache groups, TimesTen recommends that you explicitly specify the collating sequence using the NLSSORT SQL function rather than using this attribute in the connection string or DSN definition.

Operations involving character comparisons support linguistic case-sensitive collating sequences. Case-insensitive sorts may affect DISTINCT value interpretation.

NLS_SORT may affect many operations. The supported operations that are sensitive to collating sequence are:

  • MIN, MAX

  • BETWEEN

  • =, <>, >, >=, <, <=

  • DISTINCT

  • CASE

  • GROUP BY

  • HAVING

  • ORDER BY

  • IN

  • LIKE

NLS_SORT settings other than BINARY may have significant performance impact on character operations.

NLS_SORT can be modified by an ALTER SESSION SQL statement, described in Oracle TimesTen In-Memory Database SQL Reference.

Note:

Primary key indexes are always based on the BINARY collating sequence. Use of non-BINARY NLS_SORT equality searches cannot use the primary key index.

Required Privilege

No privilege is required to change the value of this attribute.

Usage in TimesTen Scaleout and TimesTen Classic

This attribute is supported in both TimesTen Classic and TimesTen Scaleout.

Setting

Set NLS_SORT as follows:

Where to set the attribute How the attribute is represented Setting

C or Java programs or UNIX and Linux systems odbc.ini file in TimesTen Classic or in the database definition (.dbdef) file in TimesTen Scaleout

NLS_SORT

Specify the linguistic sort sequence or BINARY (default).

Windows ODBC Data Source Administrator

Not applicable

Supported Linguistic Sorts

The tables in this section list the supported values for the NLS_SORT general connection attribute and the NLS_SORT SQL function.

Monolingual Linguistic Sorts

Basic name Extended name

ARABIC

N/A

ARABIC_MATCH

N/A

ARABIC_ABJ_SORT

N/A

ARABIC_ABJ_MATCH

N/A

ASCII7

N/A

AZERBAIJANI

XAZERBAIJANI

BENGALI

N/A

BIG5

N/A

BINARY

N/A

BULGARIAN

N/A

CANADIAN FRENCH

N/A

CATALAN

XCATALAN

CROATIAN

XCROATIAN

CZECH

XCZECH

CZECH_PUNCTUATION

XCZECH_PUNCTUATION

DANISH

XDANISH

DUTCH

XDUTCH

EBCDIC

N/A

EEC_EURO

N/A

EEC_EUROPA3

N/A

ESTONIAN

N/A

FINNISH

N/A

FRENCH

XFRENCH

GERMAN

XGERMAN

GERMAN_DIN

XGERMAN_DIN

GBK

N/A

GREEK

N/A

HEBREW

N/A

HKSCS

N/A

HUNGARIAN

XHUNGARIAN

ICELANDIC

N/A

INDONESIAN

N/A

ITALIAN

N/A

LATIN

N/A

LATVIAN

N/A

LITHUANIAN

N/A

MALAY

N/A

NORWEGIAN

N/A

POLISH

N/A

PUNCTUATION

XPUNCTUATION

ROMANIAN

N/A

RUSSIAN

N/A

SLOVAK

XSLOVAK

SLOVENIAN

XSLOVENIAN

SPANISH

XSPANISH

SWEDISH

N/A

SWISS

XSWISS

THAI_DICTIONARY

N/A

TURKISH

XTURKISH

UKRAINIAN

N/A

UNICODE_BINARY

N/A

VIETNAMESE

N/A

WEST_EUROPEAN

XWEST_EUROPEAN

Multilingual Linguistic Sorts

Sort Name Description

CANADIAN_M

Canadian French sort supports reverse secondary, special expanding characters.

DANISH_M

Danish sort supports sorting uppercase characters before lowercase characters.

FRENCH_M

French sort supports reverse sort for secondary.

GENERIC_M

Generic sorting order which is based on ISO14651 and Unicode canonical equivalence rules but excluding compatible equivalence rules.

JAPANESE_M

Japanese sort supports SJIS character set order and EUC characters which are not included in SJIS.

KOREAN_M

Korean sort Hangul characters are based on Unicode binary order. Hanja characters based on pronunciation order. All Hangul characters are before Hanja characters.

SPANISH_M

Traditional Spanish sort supports special contracting characters.

THAI_M

Thai sort supports swap characters for some vowels and consonants.

SCHINESE_RADICAL_M

Simplified Chinese sort is based on radical as primary order and number of strokes order as secondary order.

SCHINESE_STROKE_M

Simplified Chinese sort uses number of strokes as primary order and radical as secondary order.

SCHINESE_PINYIN_M

Simplified Chinese Pinyin sorting order.

TCHINESE_RADICAL_M

Traditional Chinese sort based on radical as primary order and number of strokes order as secondary order.

TCHINESE_STROKE_M

Traditional Chinese sort uses number of strokes as primary order and radical as secondary order. It supports supplementary characters.