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 |
|
The default value for |
Windows ODBC Data Source Administrator |
Connection CharacterSet list field on the Oracle TimesTen Client DSN Setup dialog |
The default value for |
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 |
|
Specify either |
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 |
|
|
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 |
|
Specify the linguistic sort sequence or |
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 |
---|---|
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
|
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
|
|
|
|
|
|
|
|
|
|
|
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
|
|
|
|
|
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
|
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
|
|
N/A |
|
N/A |
|
|
|
|
|
|
|
N/A |
|
|
|
N/A |
|
|
|
N/A |
|
N/A |
|
N/A |
|
|
Multilingual Linguistic Sorts
Sort Name | Description |
---|---|
|
Canadian French sort supports reverse secondary, special expanding characters. |
|
Danish sort supports sorting uppercase characters before lowercase characters. |
|
French sort supports reverse sort for secondary. |
|
Generic sorting order which is based on |
|
Japanese sort supports SJIS character set order and EUC characters which are not included in SJIS. |
|
Korean sort Hangul characters are based on Unicode binary order. Hanja characters based on pronunciation order. All Hangul characters are before Hanja characters. |
|
Traditional Spanish sort supports special contracting characters. |
|
Thai sort supports swap characters for some vowels and consonants. |
|
Simplified Chinese sort is based on radical as primary order and number of strokes order as secondary order. |
|
Simplified Chinese sort uses number of strokes as primary order and radical as secondary order. |
|
Simplified Chinese Pinyin sorting order. |
|
Traditional Chinese sort based on radical as primary order and number of strokes order as secondary order. |
|
Traditional Chinese sort uses number of strokes as primary order and radical as secondary order. It supports supplementary characters. |