@@ -489,7 +489,7 @@ node myscript.js
489
489
490
490
const oracledb = require (' oracledb' );
491
491
492
- oracledb .outFormat = oracledb .OBJECT ;
492
+ oracledb .outFormat = oracledb .OUT_FORMAT_OBJECT ;
493
493
494
494
const mypw = ... // set mypw to the hr schema password
495
495
@@ -699,8 +699,13 @@ Constants for the query result [outFormat](#propdboutformat) option:
699
699
700
700
Constant Name | Value |Description
701
701
-------------------------------------|-------|-----------------------------------------------
702
- ` oracledb.ARRAY ` | 4001 | Fetch each row as array of column values
703
- ` oracledb.OBJECT ` | 4002 | Fetch each row as an object
702
+ ` oracledb.OUT_FORMAT_ARRAY ` | 4001 | Fetch each row as array of column values
703
+ ` oracledb.OUT_FORMAT_OBJECT ` | 4002 | Fetch each row as an object
704
+
705
+ The ` oracledb.OUT_FORMAT_ARRAY ` and ` oracledb.OUT_FORMAT_OBJECT `
706
+ constants were introduced in node-oracledb 4.0. The previous
707
+ constants ` oracledb.ARRAY ` and ` oracledb.OBJECT ` are deprecated but
708
+ still usable.
704
709
705
710
#### <a name =" oracledbconstantsnodbtype " ></a > 3.1.2 Node-oracledb Type Constants
706
711
@@ -1323,18 +1328,18 @@ both [ResultSet](#propexecresultset) and non-ResultSet queries. It
1323
1328
can be used for top level queries and REF CURSOR output.
1324
1329
1325
1330
This can be either of
1326
- the [ Oracledb constants] ( #oracledbconstantsoutformat ) ` oracledb.ARRAY ` or
1327
- ` oracledb.OBJECT ` . The default value is ` oracledb.ARRAY ` which is more efficient.
1331
+ the [ Oracledb constants] ( #oracledbconstantsoutformat )
1332
+ ` oracledb.OUT_FORMAT_ARRAY ` or ` oracledb.OUT_FORMAT_OBJECT ` . The default value
1333
+ is ` oracledb.OUT_FORMAT_ARRAY ` which is more efficient.
1328
1334
1329
- If specified as ` oracledb.ARRAY ` , each row is fetched as an array of column
1330
- values.
1335
+ If specified as ` oracledb.OUT_FORMAT_ARRAY ` , each row is fetched as an array of
1336
+ column values.
1331
1337
1332
- If specified as ` oracledb.OBJECT ` , each row is fetched as a JavaScript object.
1333
- The object has a property for each column name, with the property
1334
- value set to the respective column value. The property name follows
1335
- Oracle's standard name-casing rules. It will commonly be uppercase,
1336
- since most applications create tables using unquoted, case-insensitive
1337
- names.
1338
+ If specified as ` oracledb.OUT_FORMAT_OBJECT ` , each row is fetched as a
1339
+ JavaScript object. The object has a property for each column name, with the
1340
+ property value set to the respective column value. The property name follows
1341
+ Oracle's standard name-casing rules. It will commonly be uppercase, since most
1342
+ applications create tables using unquoted, case-insensitive names.
1338
1343
1339
1344
This property may be overridden in
1340
1345
an [ ` execute() ` ] ( #executeoptions )
@@ -1346,7 +1351,7 @@ See [Query Output Formats](#queryoutputformats) for more information.
1346
1351
1347
1352
``` javascript
1348
1353
const oracledb = require (' oracledb' );
1349
- oracledb .outFormat = oracledb .ARRAY ;
1354
+ oracledb .outFormat = oracledb .OUT_FORMAT_ARRAY ;
1350
1355
```
1351
1356
1352
1357
#### <a name =" propdbpoolincrement " ></a > 3.2.15 ` oracledb.poolIncrement `
@@ -3071,8 +3076,8 @@ contains an array of fetched rows. It will be NULL if there is an
3071
3076
error or the SQL statement was not a SELECT statement. By default,
3072
3077
the rows are in an array of column value arrays, but this can be
3073
3078
changed to arrays of objects by setting
3074
- [`outFormat`](#propdboutformat) to `oracledb.OBJECT `. If a single row
3075
- is fetched, then `rows` is an array that contains one single row.
3079
+ [`outFormat`](#propdboutformat) to `oracledb.OUT_FORMAT_OBJECT `. If a single
3080
+ row is fetched, then `rows` is an array that contains one single row.
3076
3081
3077
3082
The number of rows returned is limited by
3078
3083
[`oracledb.maxRows`](#propdbmaxrows) or the
@@ -8399,10 +8404,10 @@ If run with Oracle's sample HR schema, the output is:
8399
8404
Using this format is recommended for efficiency.
8400
8405
8401
8406
Alternatively, rows may be fetched as JavaScript objects. To do so,
8402
- specify the ` outFormat` option to be ` oracledb .OBJECT ` :
8407
+ specify the ` outFormat` option to be ` oracledb .OUT_FORMAT_OBJECT ` :
8403
8408
8404
8409
` ` ` javascript
8405
- oracledb .outFormat = oracledb .OBJECT ;
8410
+ oracledb .outFormat = oracledb .OUT_FORMAT_OBJECT ;
8406
8411
` ` `
8407
8412
8408
8413
The value can also be set as an ` execute ()` option:
@@ -8413,7 +8418,7 @@ const result = await connection.execute(
8413
8418
FROM departments
8414
8419
WHERE manager_id < :id` ,
8415
8420
[110 ], // bind value for :id
8416
- { outFormat: oracledb .OBJECT }
8421
+ { outFormat: oracledb .OUT_FORMAT_OBJECT }
8417
8422
);
8418
8423
8419
8424
console .log (result .rows );
@@ -9336,7 +9341,7 @@ const result = await connection.execute(
9336
9341
FROM parts
9337
9342
ORDER BY id` ,
9338
9343
[],
9339
- { outFormat: oracledb .OBJECT }
9344
+ { outFormat: oracledb .OUT_FORMAT_OBJECT }
9340
9345
);
9341
9346
9342
9347
console .log (result .rows );
0 commit comments