Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 8i

Re: Oracle 8i

From: <oratune_at_aol.com>
Date: Thu, 05 Oct 2000 16:22:41 GMT
Message-ID: <8ri9s7$ano$1@nnrp1.deja.com>

In article <8ri95i$a4c$1_at_nnrp1.deja.com>,   erasmo_flores_at_my-deja.com wrote:
> Hy, where define the character to use for the separador of decimals ?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

From the Oracle documentation:

Numeric Formats
The database must know the number-formatting convention used in each session to interpret numeric strings correctly. For example, the database needs to know whether numbers are entered with a period or a comma as the decimal character (234.00 or 234,00). Similarly, the application needs to be able to display numeric information in the format expected at the client site.

Some typical ones are shown in Table 2-8.

Table 2-8 Numeric Formats
Country Example Numeric Formats
Estonia
 1 234 567,89

Germany
 1.234.567,89

Japan
 1,234,567.89

UK
 1,234,567.89

US
 1,234,567.89

NLS_NUMERIC_CHARACTERS
Parameter type: String

Parameter scope:
  Initialization Parameter, Environment Variable, and ALTER SESSION Default value:
  Default decimal character and group separator for a particular territory

Range of values: Any two valid numeric characters

This parameter specifies the decimal character and grouping separator, overriding those defined implicitly by NLS_TERRITORY. The group separator is the character that separates integer groups (that is, the thousands, millions, billions, and so on). The decimal character separates the integer and decimal parts of a number.

Any character can be the decimal or group separator. The two characters specified must be single-byte, and both 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 (<), greater than sign (>).

The characters are specified in the following format:

NLS_NUMERIC_CHARACTERS = "<decimal_character><group_separator>"

The grouping separator is the character returned by the number format mask G. For example, to set the decimal character to a comma and the grouping separator to a period, the parameter should be set as follows:

NLS_NUMERIC_CHARACTERS = ",." Both characters are single byte and must be different. Either can be a space.

Note: SQL statements can include numbers represented as numeric or text literals. Numeric literals are not enclosed in quotes. They are part of the SQL language syntax and always use a dot as the decimal separator and never contain a group separator. Text literals are enclosed in single-quotes. They are implicitly or explicitly converted to numbers, if required, according to the current NLS settings. For example, in the following statement:

INSERT INTO SIZES (ITEMID, WIDTH, HEIGHT, QUANTITY)      VALUES (618, '45,5', 27.86, TO_NUMBER('1.234','9G999')); 618 and 27.86 are numeric literals. The text literal '45,5' is implicitly converted to the number 45.5 (assuming that WIDTH is a NUMBER column). The text literal '1.234' is explicitly converted to a number 1234. This statement is valid only if NLS_NUMERIC_CHARACTERS is set to ",.".

You can alter the default value of NLS_NUMERIC_CHARACTERS in either of these ways:

Change the value of NLS_NUMERIC_CHARACTERS in the initialization file and then restart the instance.

Use the ALTER SESSION SET NLS_NUMERIC_CHARACTERS command to change the parameter's value during a session.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Oct 05 2000 - 11:22:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US