Oracle 参数 NLS_NUMERIC_CHARACTERS 官方解释,作用,如何配置最优化建议

本站中文解释

NLS_NUMERIC_CHARACTERS参数是控制数值显示字符,用于指定数值显示格式,即指明使用空格,逗号,句号等字符作为分隔符。

设置正确的NLS_NUMERIC_CHARACTERS参数可以让数值显示准确无误,为了避免在数据库中存在精度问题,强烈建议在建表时指定数值字段的长度和精度。

NLS_NUMERIC_CHARACTERS参数的正确设置主要依赖于数据库语言和字符集的不同,因此可以依据自己数据库的实际状况选择不同的参数设置,一般情况下,使用ALTER SESSION来设置NLS_NUMERIC_CHARACTERS:

ALTER SESSION SET NLS_NUMERIC_CHARACTERS = “., “;

在此设置中,逗号作为小数点,句号作为分组符号。

官方英文解释

NLS_NUMERIC_CHARACTERS specifies the characters to use as the group separator and decimal character.

Property Description

Parameter type

String

Syntax

NLS_NUMERIC_CHARACTERS =

"decimal_character group_separator"

Default value

Derived from NLS_TERRITORY

Modifiable

ALTER SESSION

Modifiable in a PDB

Yes

Basic

No

NLS_NUMERIC_CHARACTERS overrides those characters defined implicitly by NLS_TERRITORY. The group separator separates integer groups (that is, thousands, millions, billions, and so on). The decimal separates the integer portion of a number from the decimal portion.

You can specify any character as the decimal or group separator. The two characters specified must be single-byte and must be different from each other. The characters cannot be any numeric character or any of the following characters: plus (+), minus sign (-), less than sign (<), greater than sign (>). Either character can be a space.

For example, if you want to specify a comma as the decimal character and a space as the group separator, you would set this parameter as follows:

NLS_NUMERIC_CHARACTERS = ", "

Note:

The value of this initialization parameter NLS_NUMERIC_CHARACTERS is used to initialize the session value of this parameter, which is the actual value referenced by the SQL query processing. This initial value is overridden by a client-side value if the client uses the Oracle JDBC driver or if the client is OCI-based and the NLS_LANG client setting (environment variable) is defined. The initialization parameter value is, therefore, usually ignored.

See Also:

Oracle Database
Globalization Support Guide
for more information about this parameter


数据运维技术 » Oracle 参数 NLS_NUMERIC_CHARACTERS 官方解释,作用,如何配置最优化建议