12.07.2015 Views

Oracle SQL Developer

Oracle SQL Developer

Oracle SQL Developer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Setting up the Globalization Support Environment■■Numeric FormatsNLS_NUMERIC_CHARACTERS11.2.6.1 Numeric FormatsThe database must know the number-formatting convention used in each session tointerpret numeric strings correctly. For example, the database needs to know whethernumbers are entered with a period or a comma as the decimal character (234.00 or234,00). Similarly, applications must be able to display numeric information in theformat expected at the client site.Examples of numeric formats are shown in Table 11–3.Table 11–3CountryExamples of Numeric FormatsNumeric FormatsEstonia 1 234 567,89Germany 1.234.567,89China 1,234,567.89UK 1,234,567.89US 1,234,567.89Numeric formats are derived from the setting of the NLS_TERRITORY parameter, butthey can be overridden by the NLS_NUMERIC_CHARACTERS parameter.11.2.6.2 NLS_NUMERIC_CHARACTERSThe NLS_NUMERIC_CHARACTERS parameter specifies the decimal character andgroup separator. The group separator is the character that separates integer groups toshow thousands and millions, for example. The group separator is the characterreturned by the G number format mask. The decimal character separates the integerand decimal parts of a number. Setting NLS_NUMERIC_CHARACTERS overrides thedefault values derived from the setting of NLS_TERRITORY. The value can be any twovalid numeric characters for the decimal character and group separator.Any character can be the decimal character or group separator. The two charactersspecified must be single-byte, and the characters must be different from each other.The characters cannot be any numeric character or any of the following characters:plus (+), hyphen (-), less than sign (). Either character can be aspace.To set the decimal character to a comma and the grouping separator to a period, defineNLS_NUMERIC_CHARACTERS as follows:ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ",.";<strong>SQL</strong> statements can include numbers represented as numeric or text literals. Numericliterals are not enclosed in quotes. They are part of the <strong>SQL</strong> language syntax andalways use a dot as the decimal character and never contain a group separator. Textliterals are enclosed in single quotes. They are implicitly or explicitly converted tonumbers, if required, according to the current NLS settings.The following SELECT statement formats the number 4000 with the decimal characterand group separator specified in the ALTER SESSION statement:ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ",.";SELECT TO_CHAR(4000, '9G999D99') FROM DUAL;11-12 <strong>SQL</strong> <strong>Developer</strong> Online Help

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!