Skip to content

Commit 5f6af64

Browse files
committed
Move NLS_NUMERIC_CHARACTERS discussion to correct section on fetchAsString
1 parent 7d4b739 commit 5f6af64

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

doc/api.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,28 +3494,9 @@ console.log(0.2 + 0.7); // gives 0.8999999999999999
34943494
The primary recommendation for number handling is to use Oracle SQL or
34953495
PL/SQL for mathematical operations, particularly for currency
34963496
calculations. Alternatively you can use `fetchAsString` or
3497-
`fetchInfo` (see next section) to fetch numbers in string format, and
3498-
then use one of the available third-party JavaScript number libraries
3499-
that handles more precision.
3500-
3501-
When using `fetchAsString` or `fetchInfo`, you may need to
3502-
explicitly use `NLS_NUMERIC_CHARACTERS` to override your NLS
3503-
settings and force the decimal separator to be a period. This can
3504-
be done by executing:
3505-
3506-
```
3507-
ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '.,'
3508-
```
3509-
3510-
Alternatively you can set the equivalent environment variable prior
3511-
to starting Node.js:
3512-
3513-
```
3514-
export NLS_NUMERIC_CHARACTERS='.,'
3515-
```
3516-
3517-
Note this environment variable is not used unless the `NLS_LANG`
3518-
environment variable is also set.
3497+
`fetchInfo` (see [below](#fetchasstringhandling)) to fetch numbers in
3498+
string format, and then use one of the available third-party
3499+
JavaScript number libraries that handles more precision.
35193500
35203501
##### <a name="datehandling"></a> 9.1.6.3 Fetching Date and Timestamps
35213502
@@ -3531,7 +3512,7 @@ TIME ZONE`. In the database, `TIMESTAMP WITH LOCAL TIME ZONE` dates
35313512
are normalized to the database time zone. When retrieved, they are
35323513
returned in the session time zone.
35333514
3534-
To make appliations more portable, it is recommended to always set the
3515+
To make applications more portable, it is recommended to always set the
35353516
session time zone to a pre-determined value, such as UTC. This can be
35363517
done by setting the environment
35373518
variable
@@ -3546,9 +3527,9 @@ $ node myapp.js
35463527
The session time zone can also be changed at runtime for each connection by
35473528
executing:
35483529
3549-
```sql
3530+
```javascript
35503531
connection.execute(
3551-
"ALTER SESSION SET TIME_ZONE='UTC'"
3532+
"ALTER SESSION SET TIME_ZONE='UTC'",
35523533
function(err) { ... }
35533534
);
35543535
```
@@ -3653,6 +3634,28 @@ represented as numbers:
36533634
To map columns returned from REF CURSORS, use `fetchAsString`. The
36543635
`fetchInfo` settings do not apply.
36553636
3637+
When using `fetchAsString` or `fetchInfo` for numbers, you may need to
3638+
explicitly use `NLS_NUMERIC_CHARACTERS` to override your NLS settings
3639+
and force the decimal separator to be a period. This can be done for
3640+
each connection by executing the statement:
3641+
3642+
```javascript
3643+
connection.execute(
3644+
"ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '.,'",
3645+
function(err) { ... }
3646+
);
3647+
```
3648+
3649+
Alternatively you can set the equivalent environment variable prior
3650+
to starting Node.js:
3651+
3652+
```
3653+
$ export NLS_NUMERIC_CHARACTERS='.,'
3654+
```
3655+
3656+
Note this environment variable is not used unless the `NLS_LANG`
3657+
environment variable is also set.
3658+
36563659
##### <a name="customtypehandling"></a> 9.1.6.5 Mapping Custom Types
36573660
36583661
Datatypes such as an Oracle Locator `SDO_GEOMETRY`, or your own custom

0 commit comments

Comments
 (0)