@@ -3494,28 +3494,9 @@ console.log(0.2 + 0.7); // gives 0.8999999999999999
3494
3494
The primary recommendation for number handling is to use Oracle SQL or
3495
3495
PL/SQL for mathematical operations, particularly for currency
3496
3496
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.
3519
3500
3520
3501
##### <a name="datehandling"></a> 9.1.6.3 Fetching Date and Timestamps
3521
3502
@@ -3531,7 +3512,7 @@ TIME ZONE`. In the database, `TIMESTAMP WITH LOCAL TIME ZONE` dates
3531
3512
are normalized to the database time zone. When retrieved, they are
3532
3513
returned in the session time zone.
3533
3514
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
3535
3516
session time zone to a pre-determined value, such as UTC. This can be
3536
3517
done by setting the environment
3537
3518
variable
@@ -3546,9 +3527,9 @@ $ node myapp.js
3546
3527
The session time zone can also be changed at runtime for each connection by
3547
3528
executing:
3548
3529
3549
- ` ` ` sql
3530
+ ` ` ` javascript
3550
3531
connection .execute (
3551
- " ALTER SESSION SET TIME_ZONE='UTC'"
3532
+ " ALTER SESSION SET TIME_ZONE='UTC'" ,
3552
3533
function (err ) { ... }
3553
3534
);
3554
3535
` ` `
@@ -3653,6 +3634,28 @@ represented as numbers:
3653
3634
To map columns returned from REF CURSORS, use ` fetchAsString` . The
3654
3635
` fetchInfo` settings do not apply.
3655
3636
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
+
3656
3659
##### <a name="customtypehandling"></a> 9.1.6.5 Mapping Custom Types
3657
3660
3658
3661
Datatypes such as an Oracle Locator ` SDO_GEOMETRY ` , or your own custom
0 commit comments