Oracle® TimesTen In-Memory Database Reference Release 11.2.1 Part Number E13069-03 |
|
|
View PDF |
NLS connection attributes are set by each connection and persist for the duration of the connection. These attributes control the globalization behaviors of the data store. NLS general connection attributes are listed Table 1-4, "NLS general connection attributes" and described in detail in this section.
You can use the ALTER SESSION statement to change NLS parameters to override the values that are assigned to these attributes at connection time.
This attribute is also available as a Client connection attribute.
This attribute specifies the character encoding for the connection, which may be different from the database character set. This can be useful when you have more than one connection to a data store and one or more of those connections requires a character set that differs from that specified in the data store.
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 (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.
Character set conversions are not supported for the TIMESTEN8 character set. A ConnectionCharacterSet value of TIMESTEN8 results in an error if the value assigned to the DatabaseCharacterSet is not TIMESTEN8.
This attribute accepts the same values used for the DatabaseCharacterSet. For a list of character set names that can be used as a value for this attribute, see "Supported Character Sets" in Oracle TimesTen In-Memory Database Operations Guide.
Required privilege
No privilege is required to change the value of this attribute.
Setting
Set ConnectionCharacterSet as follows:
Where to set the attribute | How the attribute is represented | Setting |
---|---|---|
C or Java programs or UNIX ODBC.INI file | Connection CharacterSet | The default value for ConnectionCharacterSet is US7ASCII, except when the data store character set is TIMESTEN8. |
Windows ODBC Data Source Administrator | Connection CharacterSet list | The default value for ConnectionCharacterSet is US7ASCII, except when the data store character set is TIMESTEN8. |
The NLS_LENGTH_SEMANTICS attribute is used 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.
Required privilege
No privilege is required to change the value of this attribute.
Setting
Set NLS_LENGTH_SEMANTICS as follows:
Where to set the attribute | How the attribute is represented | Setting |
---|---|---|
C or Java programs or UNIX ODBC.INI file | NLS_LENGTH_ SEMANTICS | Specify either BYTE (default) or CHAR |
Windows ODBC Data Source Administrator | NLS_LENGTH_ SEMANTICS list | Select either BYTE (default) or CHAR. |
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.
Required privilege
No privilege is required to change the value of this attribute.
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 ODBC.INI file | NLS_NCHAR_ CONV_EXCP | 0 - Errors are not reported when there is a data loss during character type conversion. (default)
1 - Errors are reported when there is a data loss during character type conversion. |
Windows ODBC Data Source Administrator | NLS_NCHAR_ CONV_EXCP checkbox | checked - Error messages are not reported when there is a data loss during character type conversion. (default)
unchecked - Error messages are reported when there is a data loss during character type conversion. |
The NLS_SORT attribute indicates which collating sequence to use for linguistic comparisons. It accepts the values listed in "Supported Linguistic Sorts" in Oracle TimesTen In-Memory Database Operations Guide. All of these values may 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.
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
Only BINARY sort is supported with the TIMESTEN8 character set.
NLS_SORT settings other than BINARY may have significant performance impact on character operations.
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 indexRequired privilege
No privilege is required to change the value of this attribute.
Setting
Set NLS_SORT as follows:
Where to set the attribute | How the attribute is represented | Setting |
---|---|---|
C or Java programs or UNIX ODBC.INI file | NLS_SORT | Specify the linguistic sort sequence or BINARY (default). |
Windows ODBC Data Source Administrator | NLS_SORT dropdown list | Specify the linguistic sort sequence or BINARY (default). |