@@ -489,7 +489,7 @@ node myscript.js
489489
490490const oracledb = require (' oracledb' );
491491
492- oracledb .outFormat = oracledb .OBJECT ;
492+ oracledb .outFormat = oracledb .OUT_FORMAT_OBJECT ;
493493
494494const mypw = ... // set mypw to the hr schema password
495495
@@ -699,8 +699,13 @@ Constants for the query result [outFormat](#propdboutformat) option:
699699
700700Constant Name | Value |Description
701701-------------------------------------|-------|-----------------------------------------------
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.
704709
705710#### <a name =" oracledbconstantsnodbtype " ></a > 3.1.2 Node-oracledb Type Constants
706711
@@ -1323,18 +1328,18 @@ both [ResultSet](#propexecresultset) and non-ResultSet queries. It
13231328can be used for top level queries and REF CURSOR output.
13241329
13251330This 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.
13281334
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.
13311337
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.
13381343
13391344This property may be overridden in
13401345an [ ` execute() ` ] ( #executeoptions )
@@ -1346,7 +1351,7 @@ See [Query Output Formats](#queryoutputformats) for more information.
13461351
13471352``` javascript
13481353const oracledb = require (' oracledb' );
1349- oracledb .outFormat = oracledb .ARRAY ;
1354+ oracledb .outFormat = oracledb .OUT_FORMAT_ARRAY ;
13501355```
13511356
13521357#### <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
30713076error or the SQL statement was not a SELECT statement. By default,
30723077the rows are in an array of column value arrays, but this can be
30733078changed 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.
30763081
30773082The number of rows returned is limited by
30783083[`oracledb.maxRows`](#propdbmaxrows) or the
@@ -8399,10 +8404,10 @@ If run with Oracle's sample HR schema, the output is:
83998404Using this format is recommended for efficiency.
84008405
84018406Alternatively, 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 ` :
84038408
84048409` ` ` javascript
8405- oracledb .outFormat = oracledb .OBJECT ;
8410+ oracledb .outFormat = oracledb .OUT_FORMAT_OBJECT ;
84068411` ` `
84078412
84088413The value can also be set as an ` execute ()` option:
@@ -8413,7 +8418,7 @@ const result = await connection.execute(
84138418 FROM departments
84148419 WHERE manager_id < :id` ,
84158420 [110 ], // bind value for :id
8416- { outFormat: oracledb .OBJECT }
8421+ { outFormat: oracledb .OUT_FORMAT_OBJECT }
84178422);
84188423
84198424console .log (result .rows );
@@ -9336,7 +9341,7 @@ const result = await connection.execute(
93369341 FROM parts
93379342 ORDER BY id` ,
93389343 [],
9339- { outFormat: oracledb .OBJECT }
9344+ { outFormat: oracledb .OUT_FORMAT_OBJECT }
93409345);
93419346
93429347console .log (result .rows );
0 commit comments